Grouping Component

Function: a!grouping()

Determines the fields to group by in a query or in a chart that uses a record type as the source. The grouping should incorporate a record field, an alias, and an optional interval if grouping by a date.

See also: Chart Configuration Using Records, Column Chart Config, Bar Chart Config, Line Chart Config, Pie Chart Config, Measure Component, a!aggregationFields function


Name Keyword Types Description



Any Type

Reference to the record field to use in this grouping, configured using the recordType! domain. For example, recordType!Case.fields.status




Function to use with grouping on this field. Only relevant for date or date & time fields. Valid values: "YEAR", "MONTH".




The short name by which the result of the grouping field can be referenced in other places in the chart configuration or a!queryRecordType().

Format Value


Any Type

Display value for the given grouping value. Only applies when the grouping is used in a chart. This parameter is evaluated once for each value returned. You can reference the unformatted result from the data source using fv!value. This display value does not affect the values used in calculations for the chart; it is only used for display.




  • This configuration is used when a record type is defined as the data source for a chart or when using a!queryRecordType(). This function can be used as a primary grouping or secondary grouping in a bar, column, line, or pie chart or to define the fields in a query using a!aggregationFields().
  • a!grouping() must be used inside of a!barChartConfig(), a!columnChartConfig(), a!lineChartConfig(), a!pieChartConfig(), or a!aggregationFields()
  • The field is a required parameter. It also must reference a field from the source record type.
  • If an alias is provided, it can be used as the field in the sort parameter within the parent configuration function. When using a!grouping in a query, an alias is required.
  • The interval can only be used if the field is of type Date or Date and Time.
  • When using formatValue, the expression provided will execute for each unique value returned for the grouping. See Chart Configuration Using Records for more information on how to set up the format value and some examples.
Open in Github

On This Page