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

          Access Flexcard Data JSON with Merge Fields (Managed Package)

          For the managed package runtime, enable Flexcard element properties to access data JSON using merge fields. A merge field is a variable that references the value of a JSON node. Merge field syntax requires you to wrap a full JSON path with a curly bracket on both ends, such as {FirstName}. 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.

          Note
          Note

          Only certain element properties support merge fields.

          Common Use Cases

          • Set the value of an element's label with data coming from the data source. For example, on a Flexcard that displays an Account's primary contact information in a Block element, set the Title of the collapsible Block element to {PrimaryContactName}.

          • Pass data from from an Action element. For example, use an Update Omniscript action to pass data, such as {Id} and {Name}, from a Flexcard to the Omniscript it's embedded inside. See Update an Omniscript from a Flexcard (Managed Package).

          • Pass data to a child Flexcard from the parent's datasource. For example, update the contextId on a child Flexcard by passing {Id} as an attribute form the parent Flexcard. See Embed Flexcard Inside Another Flexcard (Managed Package).

          • Set the value of descriptive text for accessibility users. For example, select {AccountName} as the Alternative Text for an Image element that displays a company logo.

          • Display data as plain text with the Text element. For example, enter Hello {FirstName}! on a Contact Flexcard.

          Additional Syntax

          This table provides additional syntax examples for nested JSON.

          JSON Node

          Merge Field Syntax Example

          "ContactInfo": {
              "FirstName": "Margarite",
              "LastName": "Mandela"
            }

          To access a nested node, use a dot . between the parent and child node names.

          {ContactInfo.FirstName}
          //returns Margarite
          [{
              "Account":{
                  "AccRevenue":"139000000",
                  "AccPrimContact":"Sean Forbes",
                  "AccWebsite":"http://edgecomm.com",
                  "AccPhone":"(512) 757-6000",
                  "AccName":"Edge Comms",
                  "AccPostal":"78767",
                  "Contacts":[
                      {
                      "PostalCode":"78767",
                      "Country":"USA",
                      "State":"Texas",
                      "City":"Austin",
                      "Street":"313 Const Place",
                      "Phone":"(512) 757-6000",
                      "Name":"Rosa Gonzalez",
                      "Id":"0033g00000EbAAP"
                      },
                      {
                      "PostalCode":"78767",
                      "Country":"USA",
                      "State":"Texas",
                      "City":"Austin",
                      "Street":"312 Const Place",
                      "Phone":"(512) 757-6000",
                      "Name":"Sean Forbes",
                      "Id":"0033g00000EXAAP"
                      }
                  ]
              }
          }]

          To access a specific item in a data field with an array, enter the number of the index surrounded by brackets, such as [0]. For example, [0] gets the first item, [1] gets the second item, and so on.

          {Account.Contacts[0].Name}
          //returns Rosa Gonzalez
           
          Loading
          Salesforce Help | Article