---
schema_version: "1"
id: d345e6244be6097f73a6d8fc3e27ea8c4aac250ed8caa21b30887611bb533fa1
title: Access Omniscript Data JSON with Merge Fields (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_access_omniscript_data_json_with_merge_fields.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_access_omniscript_data_json_with_merge_fields.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 0bb1d6dc0a28559d538e8a829858702685609b0420d407bd724ba55474f9fd5d
description: 'For the managed package runtime, enable Omniscript elements and element properties to access data JSON using merge fields. A merge field is a variable that references the value of a JSON node. For example, if a JSON node is "FirstName": "John", then the merge field %FirstName% returns John.'
products:
  - Omnistudio
release: "264"
---
# Access Omniscript Data JSON with Merge Fields (Managed Package)

For the managed package runtime, enable Omniscript elements and element properties to access data JSON using merge fields. A merge field is a variable that references the value of a JSON node. For example, if a JSON node is `"FirstName": "John"`, then the merge field `%FirstName%` returns `John`.

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

Merge fields access data JSON using syntax to indicate to an Omniscript Element that a merge field is present. The syntax requires you to wrap a full JSON path with a percent sign on both ends.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note

Only certain element properties support merge fields.

Text between two percent (%) signs in a Set Values formula or text field is treated as a merge field. To represent literal percent (%) signs, use the `$Vlocity.Percent` [environment variable](https://help.salesforce.com/s/articleView?id=xcloud.os_environment_variables_in_dataraptors_and_integration_procedures_1.htm&release=264.0.0&type=5 "For the managed package runtime, you can use environment variables to define Default Values and Filter Values, and in Formulas.").

## Common Use Cases (Managed Package)

For the managed package runtime, learn about common use cases for accessing Omniscript data JSON with merge fields.

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

- Setting Values to rename elements, access JSON nodes, run formulas, and populate elements. For more information, see [Set Values in an Omniscript (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_set_values_in_an_omniscript.htm&release=264.0.0&type=5 "For the managed package runtime, use the Set Values action to set element values in subsequent steps, rename JSON nodes, create dynamic values, and concatenate data. Set Values actions use merge fields to access JSON data in other Omniscript elements.")
- Access data stored in Omniscript elements in a formula or in a future step.
- Access data returned from an Action. For example, an HTTP Action or Omnistudio Data Mapper Action returns data from Salesforce or an external source. For more information on Actions, see [Omniscript Action Elements (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_omniscript_action_elements.htm&release=264.0.0&type=5 "For the managed package runtime, this table provides information about Omniscript action elements.").
- Access data passed in as a parameter from a page.

## Access the Data JSON (Managed Package)

For the managed package runtime, use existing data JSON in an element property by indicating the use of a merge field.

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

1. Locate the name of the JSON node in the Omniscript's data JSON.
    
    ![image](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/omniscript_merge_data_json.png)
2. Enter the name of the JSON node and wrap the name in percentage signs to indicate it is a merge field. For example, a merge field accessing a JSON node named firstName must use the syntax %firstName%.
    
    ![image](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/omniscript_merge_syntax.png)
3. Preview the Omniscript to ensure the Merge field works correctly.
    
    ![image](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/omniscript_merge_field_result.png)

## Additional Syntax (Managed Package)

For the managed package runtime, check out additional syntax examples for nested JSON.

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

<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="d114578e270">
                  <p style="margin-bottom:0;">JSON Node</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d114578e276">
                  <p style="margin-bottom:0;">Merge Field Syntax Example</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="JSON Node" class="slds-cell-wrap" style="vertical-align:top;" headers="d114578e270 ">
                  <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>"ContactInfo": {
    "FirstName": "John"
  }</code></pre>
                </td>

                <td data-label="Merge Field Syntax Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d114578e276 ">
                  <p>Use a colon symbol <code>:</code> to access a nested JSON
                    node.</p>
                  <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>%ContactInfo:FirstName%</code></pre>
                </td>

              </tr>
              <tr class="">
                <td data-label="JSON Node" class="slds-cell-wrap" style="vertical-align:top;" headers="d114578e270 ">
                  <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>"ParentObject": {
    "NumberMap": [
      1,
      2,
      3
    ]
  }</code></pre>
                </td>

                <td data-label="Merge Field Syntax Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d114578e276 ">
                  <p>Use a colon symbol <code>:</code> to access nested JSON
                    nodes and a pipe symbol <code>|</code> to access the index
                    of the array that value.</p>
                  <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>%ParentObject:NumberMap|3%</code></pre>
                </td>

              </tr>
              <tr class="">
                <td data-label="JSON Node" class="slds-cell-wrap" style="vertical-align:top;" headers="d114578e270 ">
                  <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code> "ContactInfoStep": {
    "ContactInfoBlock": [
      {
        "FirstName": "John"
      },
      {
        "FirstName": "Adam"
      },
      {
        "FirstName": "Steve"
      }
    ]
  }</code></pre>
                </td>

                <td data-label="Merge Field Syntax Example" class="slds-cell-wrap" style="vertical-align:top;" headers="d114578e276 ">
                  <p>When a formula exists within a repeatable block, use <code>|n</code> to access the node in which the formula exists. Depending upon
                    which node the formula exists in, it will return the correlating value. For more
                    information, see <a href="https://help.salesforce.com/s/articleView?id=xcloud.os_evaluating_elements_in_repeatable_blocks.htm&amp;release=264.0.0&amp;type=5" title="For the managed package runtime, suppose you place an element in a repeatable block (a Block or an Edit Block) and you want to access data that is calculated in a different element. The method that you use to access the data depends on whether the element containing the data is within or outside the same repeatable block in the Omniscript. Review guidelines and examples for the Formula element and for the Select element, which is used to add a dependent picklist to an Omniscript.">Access to Data Within and Outside a Repeatable Block (Managed Package)</a>.</p>
                  <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>%ContactInfoStep:ContactInfoBlock|n:FirstName%</code></pre>
                </td>

              </tr>
            </tbody>
          </table>