Product picker aggregates

  • Release version: Australia
  • Updated March 12, 2026
  • 3 minutes to read
  • Aggregates help calculate and summarize data in products. Learn how to use aggregates in a product picker.

    Product pickers let users select products from a list. Aggregates help calculate and summarize data (like sums, counts, or averages) from the selected products.

    Note:
    Before you read this article, we recommend that you understand the product picker field type and how to create a product picker. See Product pickers.

    Product picker aggregates allow data collection and calculation for specific fields in a product picker. This helps analyze data directly from the product picker options.

    Suppose you have a product picker containing various measurable products, and you need to identify which product has the least volume in demand. By applying a "Min" aggregate on the volume field, the smallest value is automatically determined, streamlining the decision process without needing a rule.

    Available aggregate functions

    Aggregate Type Behavior
    Sum

    Sum of the base field values for each selected option, if they can be coerced to a number

    Does not multiply by the option quantity

    Count Count of options selected in a product picker
    Min Minimum of the base field values of the selected options, if they can be coerced to a number
    Max Maximum of the base field values of the selected options, if they can be coerced to a number
    Average Average of the base field values of the selected options, if they can be coerced to a number

    Aggregates can be configured through the UI configuration or by using admin APIs.

    Configuring aggregates through the UI

    To configure an aggregate through the UI, go to any product picker, and then on its definition page, click Option Fields. Then, in the Aggregate Fields section, click + Add.

    Product picker: Aggregates

    When you create a new aggregate, provide the following details:

    • Base Field: A list of available subfields of the product picker is displayed here. Select the sub-field to create a new aggregate.

      Product picker: Aggregates

    • Aggregate Type: Select the aggregate type whose behavior fits your use case: Sum, Average, Min, Max, or Count.

      Product picker: Aggregates

    • Aggregate Field Name: After defining the aggregate, its value is stored in a separate field to facilitate data display. This field is typically located beneath the product picker. The field's name clearly indicates that it represents an aggregate, ensuring easy interpretation. This is auto-generated by the system.
    • Variable Name: This is the variable name of the aggregate field name that is created. The variable name is usually used to reference the product picker aggregates in scripting. This is auto-generated by the system.
    • Delete: Use this icon only if you want to delete the added aggregate or if you want to remove any existing aggregates.

    Configuring aggregates through the admin APIs

    For steps to create and configure an aggregate using API calls, see Adding a product picker aggregate using APIs.

    Viewing a product picker aggregate

    Aggregate fields can be added to the layout and will automatically be calculated on the change of a field. Just as we can search a normal field by its display name or variable name and add it to the layout, we can do the same with the product picker aggregate. We search the aggregate field name or variable name of the newly created field, define the position in the layout by adding it under the product picker field for ease of display, and save the layout. To read more about the layout editor, see Layout editor.

    Product picker: Aggregates

    The product picker field “Simple SM Prod Picker“ has many subfields. On the Subfield “Quantity“, we have added three aggregates: Max, Sum, and Count.

    Products with different quantities

    Suppose product A has a quantity of 1, and product B has a quantity of 3.

    • Applying Max aggregate on quantity gives the value of aggregate field name “Quantity Max” as 3, as product a has the maximum quantity among the selected products.
    • Applying Sum aggregate on quantity gives the value of aggregate field name “Quantity Sum” as 4, as product a quantity + product b quantity has value 4.
    • Applying Count aggregate on quantity gives the value of aggregate field name “Select Count” as 2, as there are only 2 selected products among the list.