---
schema_version: "1"
id: 3bdb8ba09ebfa6b3303decc8c3ebdf6140425199d3e910da3af3499e8da2023f
title: Create a Loop Block Example that Retrieves Names (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_create_a_loop_block_example_that_retrieves_names.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_create_a_loop_block_example_that_retrieves_names.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 44ecb7a5999df5287737470427967bb19df19688548fcf58004475d338fca4da
description: For the managed package runtime, an Integration Procedure accepts last names and returns the full names of all Contacts having the specified last names.
products:
  - Omnistudio
release: "264"
---
# Create a Loop Block Example that Retrieves Names (Managed Package)

For the managed package runtime, an Integration Procedure accepts last names and returns the full names of all Contacts having the specified last names.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

To download a data pack of this example for Omnistudio for Managed Packages, click [here](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m0000005uJE/gdHEmPzKaa_jiA3obrA4gVXTJpKfg8LCKS207gp2WfY).

The Integration Procedure has these components:

- An optional Set Values component, named SetValues1
- A Loop Block component, named LoopBlock1
- An Omnistudio Data Mapper Extract Action component within the Loop Block, named DRExtractAction1
- A Data Mapper Extract that uses the LIKE operator to find names similar to those in the input, named ExtractFirstNames
- A Response Action, named ResponseAction1

The Structure panel looks like this:

![The contents of the Structure panel are listed in the preceding text.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/omnistudio_for_managed_packages/images/iploopblock1.png)

To build this Integration Procedure:

1. From the Vlocity Integration Procedures tab, click **New**.
2. Provide a unique **Integration Procedure Name**, a **Type** that can be a category, and a unique **SubType**, then click **Save**. You only have to save this one time.
3. Drag a Loop Block into the Structure panel and give it the following settings:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d24798e146">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d24798e152">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e146 ">
                  <p style="margin-bottom:0;">Loop List</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e152 ">
                  <p style="margin-bottom:0;">Set this value to <code>names</code>.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e146 ">
                  <p style="margin-bottom:0;">Additional Loop Output</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e152 ">
                  <p style="margin-bottom:0;">Set the Key to <code>DRExtractAction1</code> and the Value to <code>%DRExtractAction1%</code> to return all
                    iterations of data generated by the Data Mapper Extract Action
                    component.</p>
                </td>

              </tr>
            </tbody>
          </table>
4. Create the Data Mapper Extract that the Data Mapper Extract Action calls and give it the following settings:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d24798e223">
                  <p style="margin-bottom:0;">Tab</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d24798e229">
                  <p style="margin-bottom:0;">Settings</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Tab" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e223 ">
                  <p style="margin-bottom:0;">Element Name</p>
                </td>

                <td data-label="Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e229 ">
                  <p style="margin-bottom:0;">DRExtractAction1</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Tab" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e223 ">
                  <p style="margin-bottom:0;">Data Mapper Interface Name</p>
                </td>

                <td data-label="Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e229 ">
                  <p style="margin-bottom:0;">ExtractFirstName</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Tab" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e223 ">
                  <p style="margin-bottom:0;">Extract</p>
                </td>

                <td data-label="Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e229 ">
                  <p style="margin-bottom:0;">A Contact extract step set to <code>Contact
                                    LastName LIKE Name</code>
                  </p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Tab" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e223 ">
                  <p style="margin-bottom:0;">Output</p>
                </td>

                <td data-label="Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e229 ">
                  <p>A mapping from <code>Contact:FirstName</code> to <code>Name:First</code>
                  </p>
                  <p style="margin-bottom:0;">A mapping from <code>Contact:LastName</code> to <code>Name:Last</code>
                  </p>
                </td>

              </tr>
            </tbody>
          </table>
    
    If you aren't sure how to create a Data Mapper Extract, see the examples in [Omnistudio Data Mapper Extract Examples (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_dataraptor_extract_examples.htm&release=264.0.0&type=5 "For the managed package runtime, Data Mapper Extract examples demonstrate object relationships, paging with data values, paging with offsets, working with attributes, and relationship notation.").
5. Drag a Data Mapper Extract Action component within the Loop Block and give it the following settings:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d24798e352">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d24798e358">
                  <p style="margin-bottom:0;">Description</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e352 ">
                  <p style="margin-bottom:0;">Data Mapper Interface</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e358 ">
                  <p style="margin-bottom:0;">Set this value to <code>ExtractFirstName</code>.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e352 ">
                  <p>Input Parameters:</p>
                  <p style="margin-bottom:0;">Data Source</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e358 ">
                  <p style="margin-bottom:0;">Set this value to <code>names:Name</code>.</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e352 ">
                  <p>Input Parameters:</p>
                  <p style="margin-bottom:0;">Filter Value</p>
                </td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d24798e358 ">
                  <p style="margin-bottom:0;">Set this value to <code>Name</code>.</p>
                </td>

              </tr>
            </tbody>
          </table>
6. Drag a Response Action below the Loop Block and check **Return Full Data JSON**.
7. Go to the Preview tab and click **Edit as JSON**.
8. Copy this JSON data and paste it into the Input Parameters panel, substituting last names of your choice:
    
    ```
    {
        "names": [
            {
                "Name": "Miller"
            },
            {
                "Name": "Torres"
            }
        ]
    }
    ```
9. Click **Execute**. If you built the Integration Procedure correctly, the output looks something like this:
    
    ```
    {
      "response": {},
      "ResponseAction1Status": true,
      "LoopBlock1": [
        {
          "DRExtractAction1": {
            "Name": [
              {
                "Last": "Miller",
                "First": “Tom”
              },
              {
                "Last": "Miller",
                "First": “Sally”
              }
            ]
          },
          "DRExtractAction1Status": true,
          "LoopBlockIterationStatus": true,
          "LoopBlockIterationIndex": 1
        },
        {
          "DRExtractAction1": {
            "Name": [
              {
                "Last": "Torres",
                "First": “Maria”
              },
              {
                "Last": "Torres",
                "First": “Ricardo”
              }
            ]
          },
          "DRExtractAction1Status": true,
          "LoopBlockIterationStatus": true,
          "LoopBlockIterationIndex": 2
        }
      ],
      "LoopBlock1Status": true,
      "options": {
        "chainable": false
      },
      "names": [
        {
          "Name": "Miller"
        },
        {
          "Name": "Torres"
        }
      ]
    }
    ```
    
    To correct a component, click it in the Structure panel and edit its properties.