Group
Array Operations – Group
Summary (SEO Meta Description):
The Array Operations Group action in WeHub groups array elements by one or more fields.
Configure grouping paths to organize data into collections based on shared values.
Overview
The Group action takes an array of objects and clusters them into sub-arrays based on one or more field values.
This is useful for analytics, reporting, and preparing structured data for downstream steps.
⚙️ Configuration Options
| Field | Type | Description | 
|---|---|---|
| Label | String | Custom name for the node (e.g., "Group Patients by Doctor"). | 
| Path | String | Field path to group by (e.g., doctorId,status). Multiple paths allowed. | 
| Schema | Schema | (Optional) Schema to validate grouped output. | 
💡 Example Use Cases
- Group patients by doctor ID or location.
- Aggregate transactions by customer ID.
- Organize IoT events by device type or region.
FAQ
Q: Can I group by multiple fields?
A: Yes, add multiple paths to create compound grouping keys.
Q: What is the output format?
A: A JSON object where keys are group values and values are arrays of grouped items.
Q: Can I apply a schema on grouped results?
A: Yes, use the Schema field to validate the grouped structure.
Keywords: WeHub Array Operations, Group Array, aggregate, cluster, group by field