You are here:
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.
Required Editions
| User Permissions Needed | |
|---|---|
| To create a flow: | Manage Flows |
An Explainability Action Definition named Example must be available in your Salesforce org. The definition must also have an associated Explainability Action Version.
- From Setup, in the Quick Find box, enter Flows, and then select Flows.
- Click New Flow.
- Select Screen Flow and click Create.
-
On the Flow Builder canvas, click
, and select Screen.
-
Configure the screen.
-
In the Screen Properties, for Label, enter Gym Membership
Offer.
The API Name autopopulates.
- Expand Configure Header and deselect Show Header.
-
Expand Configure Footer, and for Next or Finish Button, select Use a
custom label and enter Calculate.
Hide the Previous and Pause buttons if you don’t need them.
- From the Components panel, select Display Text, and enter an API name for the component.
-
To set the context to launch the flow, enter some explanatory text. .
Here’s an example.

- From the Components panel, select Number, and for Label, enter Step Count.
- Set the Number component as required.
- Save your changes.
-
In the Screen Properties, for Label, enter Gym Membership
Offer.
-
To invoke the expression set, click
, and select Action.
-
In the Action field, search for Gym, and select the AnnualGymMembership expression
set.
- For label, enter Calculate Gym Membership.
-
To capture Decision Explainer logs for each run of the expression set, include
_actionContextCode.
- To capture action logs on the Contact object, in the _actionContextCode field, select New Resource.
- For Resource Type, select Variable.
- For API name, enter ContactRecord.
- For Data Type, select Record.
- For Object, select Contact.
- Select Available for Input and Available for Output.
-
Click Done.
The variable appears in the _actionContextCode field.
-
Click inside {} and enter .Id after !ContactRecord.
- For _explainabilitySpecName, enter Example.
-
For ApplicantId, from the Record (SINGLE) Variables section, select
ContactRecord, and then select Id.
- To pass the step count to the expression set when the flow is triggered, for Steps, select Step_Count.
- Click Done.
-
To update the discounted gym membership fees on a contact’s record detail page, click
, and select
Action, and from the Data section, select Update
Records.
- For Label, enter Update Gym Membership.
- Select Specify conditions to identify records, and set fields individually..
- For Object, select Contact.
- For Field, select Id.
- To map the record ID to the contact for whom the flow is run, for Value, select ContactRecord, and then select Id.
- To set field values for the Contact records, for the Field, select Gym_Fees_c.
-
For Value, from the Actions section, select the expression set, and then select the
DiscountedGymFees output variable.
- Click Done.
-
Save the flow.
For Flow Label, enter Calculate Discounted Gym Fees.
-
To verify that the flow works as expected, click Debug.
- For ContactRecord, select a contact from your Salesforce org, and click Run.
-
Enter a step count, and click Calculate.
The step-by-step flow results appear in the Debug Details section. Here are the results of the sample data for the expression set action and update records steps.

- Activate the flow.
Did this article solve your issue?
Let us know so we can improve!

