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
          Access Omniscript Data JSON with Merge Fields (Managed Package)

          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 This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

          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
          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.

          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 This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

          • Setting Values to rename elements, access JSON nodes, run formulas, and populate elements. For more information, see Set Values in an Omniscript (Managed Package)
          • 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).
          • 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 This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

          1. Locate the name of the JSON node in the Omniscript's data JSON.
            image
          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
          3. Preview the Omniscript to ensure the Merge field works correctly.
            image

          Additional Syntax (Managed Package)

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

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

          JSON Node

          Merge Field Syntax Example

          "ContactInfo": {
              "FirstName": "John"
            }

          Use a colon symbol : to access a nested JSON node.

          %ContactInfo:FirstName%
          "ParentObject": {
              "NumberMap": [
                1,
                2,
                3
              ]
            }

          Use a colon symbol : to access nested JSON nodes and a pipe symbol | to access the index of the array that value.

          %ParentObject:NumberMap|3%
           "ContactInfoStep": {
              "ContactInfoBlock": [
                {
                  "FirstName": "John"
                },
                {
                  "FirstName": "Adam"
                },
                {
                  "FirstName": "Steve"
                }
              ]
            }

          When a formula exists within a repeatable block, use |n 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 Access to Data Within and Outside a Repeatable Block (Managed Package).

          %ContactInfoStep:ContactInfoBlock|n:FirstName%
           
          Loading
          Salesforce Help | Article