Key Facts
- Category
- Data Processing
- Input Types
- textarea, select, text
- Output Type
- text
- Sample Coverage
- 4
- API Ready
- Yes
Overview
The Group By tool allows you to organize complex JSON collections into structured groups based on a specific property or path, powered by the reliable lodash _.groupBy function.
When to Use
- •When you need to categorize items in a large JSON array by a shared attribute.
- •When you want to transform a flat list of objects into a dictionary for faster lookups.
- •When preparing data for reports or UI components that require grouped data structures.
How It Works
- •Paste your JSON array or object into the Collection field.
- •Select the Iteratee Type to determine how the grouping key is derived.
- •Specify the property name or path if using the Property/Path mode.
- •Run the tool to receive a new JSON object where keys represent the groups and values contain the associated items.
Use Cases
Examples
1. Categorizing Product Inventory
- Background
- An e-commerce manager has a flat list of products and needs to display them by category on a dashboard.
- Problem
- The raw data is a single array, making it difficult to render category-specific sections.
- How to Use
- Input the product array, set Iteratee Type to 'Property/Path', and set Iteratee to 'category'.
- Example Config
-
Collection: [{"name":"Laptop","category":"Electronics"},{"name":"Shirt","category":"Apparel"},{"name":"Phone","category":"Electronics"}] - Outcome
- A JSON object grouped by category, with 'Electronics' containing the laptop and phone, and 'Apparel' containing the shirt.
2. Grouping API Response Logs
- Background
- A developer is debugging server logs and needs to see all failed requests together.
- Problem
- The logs are mixed together, making it hard to identify patterns in error codes.
- How to Use
- Input the log array, set Iteratee Type to 'Property/Path', and set Iteratee to 'status'.
- Example Config
-
Collection: [{"id":1,"status":200},{"id":2,"status":500},{"id":3,"status":200}] - Outcome
- A grouped object where keys '200' and '500' contain their respective log entries, allowing for quick analysis of errors.
Try with Samples
jsonRelated Hubs
FAQ
What input formats are supported?
The tool accepts standard JSON arrays or objects.
What is the difference between Identity and Property/Path?
Identity groups items by their own values, while Property/Path allows you to specify a key or nested path within each object to group by.
Does this tool modify my original data?
No, it processes your input and returns a new structured result without altering the original source.
Can I group by nested properties?
Yes, by selecting Property/Path and providing the dot-notation path to the nested key.
Is this tool based on a specific library?
Yes, it utilizes the industry-standard lodash _.groupBy function for consistent and accurate results.