Skip to content

Group By

The Group By node groups rows by a field value, producing an array of group objects. Each group contains the field value, the matching rows, and a count.

Configuration

PropertyTypeDefaultDescription
fieldstring--Required. The field name to group by.

Input

Accepts an array of rows.

Output

Returns an array of group objects:

json
[
  {
    "_group_key": "Electronics",
    "_group_items": [
      { "id": 1, "name": "Laptop", "category": "Electronics" },
      { "id": 3, "name": "Phone", "category": "Electronics" }
    ],
    "_group_count": 2
  },
  {
    "_group_key": "Books",
    "_group_items": [
      { "id": 2, "name": "Novel", "category": "Books" }
    ],
    "_group_count": 1
  }
]

Group Object Fields

FieldTypeDescription
_group_keystringThe value of the grouped field.
_group_itemsarrayThe rows in this group.
_group_countnumberThe number of rows in this group.

Rows where the field is null are grouped under _null.

Example Use Cases

Group products by category

field: "category"

Display with a nested repeater: the outer repeater iterates groups, the inner repeater iterates _group_items.

Group orders by status

field: "status"

Show counts per status: { {row._group_key}}: { {row._group_count}} orders.

Group events by date

field: "event_date"

Create a date-based event calendar layout.

TIP

Use the _group_count field for summary statistics without needing a separate Math node.