You are here:
Example of Invoking a Decision Explainer Enabled Expression Set from Flow
This example shows how to invoke an expression set that uses Decision Explainer from flow. The example also shows how to view every run of the expression set in the action logs for the context in which the expression set is run.
Required Editions
| Available in: Lightning Experience |
| Available in: Enterprise, Unlimited, and Developer Editions for Industries clouds that have Business Rules Engine and Decision Explainer enabled. |
To promote fitness and well-being, a company is offering a discount on its annual gym membership to its contacts. To encourage physical movement, the company launched a week-long step challenge for its contacts. The annual membership price is $1,000. A discount is offered on this price based on a contact’s age and the step count from the week-long step challenge.
The company’s sales team gave the rule designer and the Salesforce admin the age and step count ranges and the applicable discount percentages. The company also asked that the discounted gym membership fees be updated on a contact’s record detail page for quick reference.
The rule designer contacted the company’s Salesforce admin and together they divided the requirement into these tasks:
| Task | Description |
|---|---|
| Create a decision matrix to calculate the discount percent based on the step count from the step challenge. | The matrix uses an input column with the datatype number range to capture the step count. The matrix captures the discount percent in the output column for these ranges. |
| Create a decision matrix to get age-based discount. | The matrix uses an input column with the data type number range to define the age range. The matrix captures the discount percent in the output column for these ranges. |
| Create an expression set and its version to design the end-to-end rule to calculate the discounted gym membership. | The expression set version:
|
| Create a flow to run the expression set and return the output to the flow. |
|
| To launch the flow for a contact, add the flow action to the contact record detail page. |
|
| View the action log for the flow. | The customer service associates can see the Decision Explainer Log History on the contact’s record detail page to check how the gym membership fees for the contact were calculated. |
- Example: Create a Decision Matrix to Get Step-Based Discount Percent
Create a decision matrix and configure its version with an input column for number of steps, and an output column with the corresponding discount percent based on a number range of steps. - Example: Create a Decision Matrix to Get Age-Based Discount
Create a decision matrix and configure its version with an input column for age, and an output column with corresponding discount percent based on the age range. - Example: Create an Expression Set to Calculate Discounted Membership Fees
Configure the expression set version to calculate a contact’s age from their birth date, look up the contact’s step count to get the steps-based discount, and return the discounted gym membership fee after subtracting the total discount from the base membership fee. - Example: Create a Flow to Run the Expression Set and Update the Record
Create an input form to capture a contact’s step count and pass it to the expression set action. Configure the flow to update the contact record with the expression set’s output. - Example: Add the Flow to the Contact Record Page and Run the Flow
To enter the step count for a contact from the contact’s record page, and pass the contact’s record ID to the flow from the same page, add a flow component to the Contact Record Page. - Example: View Decision Explainer Log History
View the action log for the expression set that was run from the flow for a contact record.

