Loading
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
          Lookup of Multiple Input Values

          Lookup of Multiple Input Values

          When you add a lookup table to an expression set version that is associated with a context definition, you can map the table’s input variables to list variables from the definition. With this mapping, you can look up multiple values in the list variable at the same time and get their corresponding output values.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Unlimited, and Developer Editions for clouds that have Business Rules Engine enabled
          Note
          Note Only users with the Rule Engine Advanced Designer permission set can map lookup table variables to list variables.
          Example
          Example Donisha, a rule designer, wants to design an expression set version to calculate the discounted price on certain items in an apparel catalog. Here’s how she configures the expression set:
          • Creates an expression set that’s associated with a context definition that has tags. The tags store various details related to apparel.
          • Creates a decision matrix named Apparel_Price to look up the price of an apparel item based on the item’s size, brand, and fabric.
          • Adds a lookup table step to the expression set version and selects the decision matrix.
          • Adds a calculation step to perform further calculation on the prices retrieved from the lookup table step.

          The matrix column names are imported into the version as the version’s local resources.

          Lookup table variables showing in Resource Manager under local resources.

          To get the prices of multiple apparel items from the lookup table simultaneously, Donisha maps the table’s variables to list variables from the ApparelCatalog context definition that’s associated with the expression set. She knows that the mapping is successful when the local variables that are imported from the lookup table are removed from the resources list.

          Lookup table variables mapped to list variables from associated context definition

          The calculation step takes the corresponding prices for the inputs from the lookup table and calculates the revised prices at a discount of 15%. The revised price is written back to the context definition associated with the Price tag.

          Calculation step to perform mathematical operations on results from list variable lookup.

          To test whether the steps worked as expected, Donisha simulates the expression set version.

          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.

          Here’s how Donisha simultaneously passes two sets of input values for the mapped list variables to the expression set version.

          {
            "ApparelCatalog": [
              {
                "Size": "L",
                "Fabric": "Wool",
                "Brand": "ABC",
                "Name": "Sweater"
              },
              {
                "Size": "S",
                "Fabric": "Denim",
                "Brand": "NA",
                "Name": "Dress"
              }
            ]
          }

          When the version is simulated, it generates the results for the two sets of inputs for both the lookup table step and the calculation step.

          Simulation resultsList showing simulation details
           
          Loading
          Salesforce Help | Article