Loading
Salesforce now sends email only from verified domains. Read More
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
          Process Arrays Using Loop Blocks (Managed Package)

          Process Arrays Using Loop Blocks (Managed Package)

          For the managed package runtime, a Loop Block iterates over the items in a data array, enabling the Actions within it to repeat for each item. For example, in ​Salesforce Industries Communications, Media, and Energy, without a Loop Block, adding four products to a cart would require running four separate Remote Actions. But one Remote Action within a Loop Block can add all four products.

          Managed Package app icon This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

          Loop Blocks are available in Spring '19 and later releases.

          The array input to the Loop Block is processed so that each iteration receives only one item in the array. For example, suppose the array input looks like this:

          {
            "Products": {
              "Ids": [
                {
                  "Id": 1
                },
                {
                  "Id": 2
                }
              ]
            }
          }

          Each iteration of the Loop Block would receive input that looks like this:

          {
            "Products": {
              "Ids": {
                "Id": 1
              }
            }
          }

          The iteration input is the data to which Actions within the Loop Block have access.

          Note
          Note

          Nested Loop Blocks aren't supported. However, you can call one Integration Procedure with a Loop Block from another.

          Note
          Note For a Loop Block that calls an Omnistudio Data Mapper Transform, a list with more than 1000 items degrades performance. You can use a paging strategy to break up long lists.

          To configure a Loop Block:

          1. Drag a Loop Block into the structure panel.
          2. In the Loop Block property field labeled Loop List, enter the name of a JSON node that contains an array of data. For example, entering Products:Ids provides a list of Ids to the Action. The JSON node name does not need to be entered with merge field syntax.
          3. Add any Action that needs to iterate over the array and pass the full the path of the array to the action.

            For example, if the Loop List is set to an array named Products:Ids that contains key-value pairs of Ids, the full path in the action would be Products:Ids:Id.

            For more information on Actions, see Integration Procedure Actions (Managed Package).

            Note
            Note

            The Integration Procedure stops running and returns a response of { "Success": "False" } if an Action that has Fail on Step Error checked fails.

          4. Under the Loop Block property field labeled Loop Output, click Add Key/Value Pair to add Key-Value pairs to set the response. The value field uses merge field syntax, meaning the node name of the response set between two percentage signs, for example, %ResponseData:Names%.
          5. (Optional) Add Conditional Logic to define when the Loop Block runs. For more information on Conditional Logic, see Define Execution Logic Using Conditional Blocks (Managed Package).
           
          Loading
          Salesforce Help | Article