Loading
Salesforce now sends email only from verified domains. Read More
Business Rules Engine
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Example: Create a Flow to Run the Expression Set and Update the Record

          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.

          1. From Setup, in the Quick Find box, enter Flows, and then select Flows.
          2. Click New Flow.
          3. Select Screen Flow and click Create.
          4. On the Flow Builder canvas, click Add flow element., and select Screen.
          5. Configure the screen.
            1. In the Screen Properties, for Label, enter Gym Membership Offer.
              The API Name autopopulates.
            2. Expand Configure Header and deselect Show Header.
            3. 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.
            4. From the Components panel, select Display Text, and enter an API name for the component.
            5. To set the context to launch the flow, enter some explanatory text. .
              Here’s an example.

              Flow screen example.

            6. From the Components panel, select Number, and for Label, enter Step Count.
            7. Set the Number component as required.
            8. Save your changes.
          6. To invoke the expression set, click Add flow element., and select Action.
          7. In the Action field, search for Gym, and select the AnnualGymMembership expression set.

            Select expression set in the Action field..

          8. For label, enter Calculate Gym Membership.
          9. To capture Decision Explainer logs for each run of the expression set, include _actionContextCode.
            1. To capture action logs on the Contact object, in the _actionContextCode field, select New Resource.
            2. For Resource Type, select Variable.
            3. For API name, enter ContactRecord.
            4. For Data Type, select Record.
            5. For Object, select Contact.
            6. Select Available for Input and Available for Output.
            7. Click Done.
              The variable appears in the _actionContextCode field.
            8. Click inside {} and enter .Id after !ContactRecord.

              Example of how the variable should look in the actionContextCode field.

          10. For _explainabilitySpecName, enter Example.
          11. For ApplicantId, from the Record (SINGLE) Variables section, select ContactRecord, and then select Id.

            Example of how the variable name is populated in the ApplicantId field.

          12. To pass the step count to the expression set when the flow is triggered, for Steps, select Step_Count.
          13. Click Done.
          14. To update the discounted gym membership fees on a contact’s record detail page, click Add flow element., and select Action, and from the Data section, select Update Records.
            1. For Label, enter Update Gym Membership.
            2. Select Specify conditions to identify records, and set fields individually..
            3. For Object, select Contact.
            4. For Field, select Id.
            5. To map the record ID to the contact for whom the flow is run, for Value, select ContactRecord, and then select Id.
            6. To set field values for the Contact records, for the Field, select Gym_Fees_c.
            7. For Value, from the Actions section, select the expression set, and then select the DiscountedGymFees output variable.

              Update record action configuration in flow.

            8. Click Done.
          15. Save the flow.
            For Flow Label, enter Calculate Discounted Gym Fees.
          16. To verify that the flow works as expected, click Debug.
            1. For ContactRecord, select a contact from your Salesforce org, and click Run.
            2. 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.

              Debug flow results.

          17. Activate the flow.
           
          Loading
          Salesforce Help | Article