GROUP_BY now supports returning an array

Formulas |

GROUP_BY can now return an array of groups by using the optional as_array parameter.

Example:

employees = [
  { "name": "Alice", "office": "Dublin" },
  { "name": "Bob", "office": "Dublin" },
  { "name": "Charlie", "office": "New York" },
  { "name": "Dave", "office": "New York" }
]

GROUP_BY(employees, "office", as_array: TRUE)

Returns:

[
  {
    "key": "Dublin",
    "values": [
      { "name": "Alice", "office": "Dublin" },
      { "name": "Bob", "office": "Dublin" }
    ]
  },
  {
    "key": "New York",
    "values": [
      { "name": "Charlie", "office": "New York" },
      { "name": "Dave", "office": "New York" }
    ]
  }
]

For more information, see our documentation.

Built by you,
powered by Tines

Already have an account? Log in.