Loading
Important Advisory: iOS Update Impacting CG Mobile ApplicationRead More
Business Rules Engine
List Branch

List Branch

In an expression set version that's associated with a context definition, a list branch step element lets you build if-then-else rule conditions directly on list data from the context.

Required Editions

Available in: Lightning Experience
Available in: Enterprise, Unlimited, and Developer Editions for clouds that have Business Rules Engine enabled

List Branch Structure

A list branch element starts with two If branch and one Else branch. You can add up to three more If branches, for a total of five If branches, plus the default Else branch. The conditions in all If branches must evaluate list data at the same hierarchy level so that every branch operates on the same list. The Else branch doesn't have a condition and can't be deleted; it processes any record that doesn't satisfy any of the If branch conditions.

Supported Elements Within a Branch

Within an If branch or the Else branch, you can add these step elements: calculation, lookup table, and subexpression. These steps operate only on the subset of list records that satisfied that branch's condition. For example, a lookup table added to a branch receives only the records that matched the branch's condition as its input.

Considerations for Using the List Branch Element

  • The List Branch container counts as one element toward the maximum number of steps that an expression set version can have. Each step element that you add within a branch is counted separately. For example, a branch that contains a calculation and a lookup table counts as two elements, in addition to the List Branch container.
  • Branches run in order from left to right. Path 1 is evaluated first, followed by Path 2, and so on, with the Else branch evaluated last.
  • Each list record is processed by only one branch: the first branch whose condition it satisfies.
Example: Tiered Pricing Discounts
Example: Tiered Pricing Discounts

A rule designer wants to apply tiered pricing discounts to a list of order line items based on each item's customer tier. The expression set is associated with a context definition that has attribute tags for the order line items, including Tier and Price. Here's how the designer configures the list branch element:

Branch and Condition Action
Path 1: Tier is Gold Apply a 15% discount
Path 2: Tier is Silver Apply a 10% discount
Else: All other line items No discount is applied

Each branch contains a calculation element that computes the discounted price for the records that enter that branch.

The designer simulates the expression set version with 10 order line items: 4 items have a Gold tier, 5 items have a Silver tier, and 1 item has a Bronze tier.

The simulation results show that the 4 Gold-tier line items follow Path 1 and receive a 15% discount, the 5 Silver-tier line items follow Path 2 and receive a 10% discount, and the remaining Bronze-tier line item follows the Else branch and receives no discount.

 
Loading
Salesforce Help | Article