Loading
Business Rules Engine
List Group and List Filter

List Group and List Filter

A list group step element filters items in a list based on the filter conditions, and then performs further operations on the filtered list. A list group can have these elements: list filter, calculation, lookup table, and business element. A list filter is always the first step in a list group, and defines how items in list variables are filtered. A list group can have only one list filter, but multiple calculation, lookup table, or business elements.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions for clouds that have Business Rules Engine enabled
Note
Note You can add a business element to a list group only if your Salesforce org has a business element. The business element must have the same usage type as the expression set whose version the element is to be added to.
Example
Example Donisha, a rule designer, wants to design an expression set version to filter items in an apparel catalog based on the item’s fabric and size. She then wants to apply a 10 percent discount on the price of such filtered list items. Here’s how she configures the expression set and its version:
  • Creates an expression set that’s associated with a context definition that has attribute tags that store various details related to the apparel catalog.
  • Adds a list group step element to the expression set version.
  • Configures the list filter in the list group, to filter items from the catalog that are made from cotton or have the size S.
  • Adds a calculation step to calculate the updated price of the filtered items after deducting 10% from the price.
List group example

In this image, the items listed under ApparelCatalog are context definition tags that appear as list variables in the version. In the list filter, Donisha adds two conditions: The Fabric is cotton or the Size is S. The filter shows the items from the apparel list that meet either condition. Donisha then adds a calculation step to get the updated price for the filtered items. Price is a tag from the ApparelCatalog context definition and is used as a list variable in the calculation. Therefore, when the expression set runs, the updated price is written back to the context definition.

She then simulates the version to verify that her rule works as expected.

Note
Note To simulate expression set versions that use list variables in the steps, use the Advanced input mode to enter your inputs in JSON format.
Advanced input mode in simulation

Here’s how she simultaneously passes multiple sets of input values for the simulation.

{
  "ApparelCatalog": [
    {
      "Size": "M",
      "Price": "50",
      "Fabric": "Silk"
    },
    {
      "Size": "S",
      "Price": "45",
      "Fabric": "Linen"
    },
    {
      "Size": "S",
      "Price": "40",
      "Fabric": "Cotton"
    },
    {
      "Size": "L",
      "Price": "55",
      "Fabric": "Cotton"
    }
  ]
}

The simulation results indicate that the filter condition evaluated to true for three of the four values passed for the list variables.

List filter simulation example

Here’s the corresponding discounted price of the filtered items.

List group's simulation on calculation element.
 
Indlæser
Salesforce Help | Article