---
schema_version: "1"
id: 9441d59c7758f06a188daa544c35861ca7206cb0c923338a71cc1f106a671289
title: Create a Top-Level Caching Example
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_create_a_top_level_caching_example_54974.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_create_a_top_level_caching_example_54974.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a0d0221d41d02e60fba42dcf9f5d1ed5c486b43159a92995e40b90775073c028
description: An Integration Procedure accepts a list of first or last names and retrieves Contacts having those names. Top-level caching to the VlocityAPIResponse partition improves Contact retrieval performance.
release: "264"
---
# Create a Top-Level Caching Example

An Integration Procedure accepts a list of first or last names and retrieves Contacts having those names. Top-level caching to the VlocityAPIResponse partition improves Contact retrieval performance.

This Integration Procedure also includes a Loop Block; see [Work with Data and Lists](https://help.salesforce.com/s/articleView?id=xcloud.os_ips_work_with_data_and_lists.htm&release=264.0.0&type=5 "Use Integration Procedures to read, write, and transform complex, hierarchical data from Salesforce objects and other sources. Use actions to work with data, and blocks to process it.").

To download a DataPack of this example for Omnistudio, click [here](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000nWog/z.7RiL3ZZjHd0K0NK.IMXxDIrapQvI4Eu7lNdkFoK0Y).

This Integration Procedure has these components:

- A Loop Block, named LoopBlock1
- An Omnistudio Data Mapper Extract Action within the Loop Block, named ExtractContact
- A Response Action, named ResponseAction

To build this Integration Procedure:

1. From the Omnistudio Integration Procedures tab, click **New**.
2. Provide an **Integration Procedure Name**, a **Type**, and a **SubType**, and click **Save**.
3. In the Procedure Configuration, set the Salesforce Platform Cache Type to **Org Cache**.
4. Drag a Loop Block component into the Structure panel. Give the Loop Block 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="d46166e120">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d46166e126">
                  <p style="margin-bottom:0;">Value</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d46166e120 ">
                  <p style="margin-bottom:0;">Loop List</p>
                </td>

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

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

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d46166e126 ">
                  <p style="margin-bottom:0;"><code>ExtractContact</code> set to <code>%ExtractContact%</code>
                  </p>
                </td>

              </tr>
            </tbody>
          </table>
5. Create the Data Mapper Extract that the Data Mapper Extract Action calls, name it ExtractContactName, 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="d46166e193">
                  <p style="margin-bottom:0;">Tab</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d46166e199">
                  <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="d46166e193 ">
                  <p style="margin-bottom:0;">Extract</p>
                </td>

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

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

                <td data-label="Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d46166e199 ">
                  <p>A mapping from <code>Contact:Id</code> to
                    <code>Contact:Id</code>
                  </p>
                  <p style="margin-bottom:0;">A mapping from <code>Contact:Name</code> to
                    <code>Contact:Name</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](https://help.salesforce.com/s/articleView?id=xcloud.os_dataraptor_extract_examples_46190.htm&release=264.0.0&type=5 "Data Mapper Extract examples demonstrate object relationships, paging with data values, paging with offsets, and relationship notation.").
6. Drag a Data Mapper Extract Action inside 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="d46166e290">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d46166e296">
                  <p style="margin-bottom:0;">Value</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d46166e290 ">
                  <p style="margin-bottom:0;">Element Name</p>
                </td>

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

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

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

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

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d46166e296 ">
                  <p style="margin-bottom:0;">names:name</p>
                </td>

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

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

              </tr>
            </tbody>
          </table>
7. Create the Response Action below 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="d46166e388">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d46166e394">
                  <p style="margin-bottom:0;">Value</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d46166e388 ">
                  <p style="margin-bottom:0;">Send JSON Path</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d46166e394 ">
                  <p style="margin-bottom:0;">LoopBlock1:ExtractContact</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Property" class="slds-cell-wrap" style="vertical-align:top;" headers="d46166e388 ">
                  <p style="margin-bottom:0;">Response JSON Node</p>
                </td>

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

              </tr>
            </tbody>
          </table>
8. In the Procedure Configuration, click **Activate Version**.
9. On the Preview Tab, click **Edit as JSON** and provide input with the following structure:
    
    ```
    {
        "names": [
            {
                "name": "Miller"
            },
            {
                "name": "Torres"
            }
        ]
    }
    ```
    
    To demonstrate performance most effectively, specify common names or many names.
10. Click **Execute** and note the resulting Browser, Server, and Apex CPU values.
11. Open the Options pane and change the `ignoreCache` value to `false`.
12. Click **Execute** again. This step populates the cache, so the resulting Browser, Server, and Apex CPU values are likely to be similar to the previous values.
13. Click **Execute** a third time. This step uses the cached values, so the resulting Browser, Server, and Apex CPU values are likely to be noticeably less than the previous values. In addition, `Cached Response: true` appears after the performance metrics.