---
schema_version: "1"
id: 2abcac854299f1e34369abac93fec4adb6bd05906197a333dd6a99024509a25f
title: Create a Top-Level Caching Example (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_top_level_caching_example.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_create_a_top_level_caching_example.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a7bea4def43a9dc68cabe5ae8962c336670f9d7c355724c326427ebda3f0e6a8
description: For the managed package runtime, 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.
products:
  - Omnistudio
release: "264"
---
# Create a Top-Level Caching Example (Managed Package)

For the managed package runtime, 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.

![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).

This Integration Procedure also includes a Loop Block; see [Process Arrays Using Loop Blocks (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_process_arrays_using_loop_blocks.htm&release=264.0.0&type=5 "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.").

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

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

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/ipcachetoplevel1.png)

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="d232356e150">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d232356e156">
                  <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="d232356e150 ">
                  <p style="margin-bottom:0;">Loop List</p>
                </td>

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

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

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d232356e156 ">
                  <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="d232356e223">
                  <p style="margin-bottom:0;">Tab</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d232356e229">
                  <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="d232356e223 ">
                  <p style="margin-bottom:0;">Extract</p>
                </td>

                <td data-label="Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d232356e229 ">
                  <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="d232356e223 ">
                  <p style="margin-bottom:0;">Output</p>
                </td>

                <td data-label="Settings" class="slds-cell-wrap" style="vertical-align:top;" headers="d232356e229 ">
                  <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 (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.").
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="d232356e320">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d232356e326">
                  <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="d232356e320 ">
                  <p style="margin-bottom:0;">Element Name</p>
                </td>

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

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

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

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

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d232356e326 ">
                  <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="d232356e320 ">
                  <p style="margin-bottom:0;">Filter Value</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d232356e326 ">
                  <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="d232356e418">
                  <p style="margin-bottom:0;">Property</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d232356e424">
                  <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="d232356e418 ">
                  <p style="margin-bottom:0;">Send JSON Path</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d232356e424 ">
                  <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="d232356e418 ">
                  <p style="margin-bottom:0;">Response JSON Node</p>
                </td>

                <td data-label="Value" class="slds-cell-wrap" style="vertical-align:top;" headers="d232356e424 ">
                  <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`.
    
    ![Under Errors/Debug Output are the Debug Log, errors, and Options panes. The Options pane is expanded to reveal resetCache, ignoreCache, and other options.](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/cachingpreviewoptions.png)
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.