---
title: "group by to map · RUAL Documentation"
description: "Groups the elements of the given array by a specified field and returns them as a map."
canonical: https://docs.rual.nl/block-types/array/array_group_by_to_map
language: en
---

# group by to map

This block is part of the [`array`](https://docs.rual.nl/block-types/array) group and was last modified in core [`v14.0.4`](https://docs.rual.nl/core-versions/140004).

Groups the elements of the given array by a specified field and returns them as a map.

- Array required `array` The array of objects to be grouped.

- field required `value` The field based on which to group the objects.

- map `object` An object with the value of the given field as keys and all items with the same value as values.

Outputs an object mapping the TEXT of each item's field value to the array of items carrying that value, preserving item order within each group. Non-object items and items lacking the field collect under the key "none". field defaults to "group" when unwired.

A typical wiring for [group by to map](https://docs.rual.nl/block-types/array/array_group_by_to_map): the `object` out pin feeds [custom field](https://docs.rual.nl/block-types/object/object_get_custom_field).

![Studio canvas example for the group by to map block: typical wiring for group by to map.](https://docs.rual.nl/canvas-examples/array_group_by_to_map.png)

### Version history

Introduced in [`v14.0.4`](https://docs.rual.nl/core-versions/140004).
