Salesforce FlexCard Merge Fields enable dynamic data display within OmniStudio FlexCards by pulling in data from Salesforce sources, such as DataRaptors or Integration Procedures. Using merge fields, developers can efficiently insert real-time data directly into FlexCard elements, such as text, fields, or actions. This feature is ideal for dashboards or summary components where current data is essential, as merge fields allow FlexCards to update automatically without manual input.
Introduction to Salesforce FlexCard Merge Fields
In addition to displaying data, Salesforce FlexCard Merge Fields enhance user interactivity by customizing actions based on each record’s data. For example, action buttons can navigate to specific pages using unique identifiers provided by merge fields, making FlexCards more functional and responsive to user interactions. This setup simplifies data presentation and promotes data-driven decision-making across Salesforce environments.
Key FlexCard Elements Utilizing Merge Fields
FlexCard elements like Text, Field, and Action allow seamless data merging. Here’s how each element interacts with merge fields for efficient data display.
| Element | Description | Example Merge Field Syntax |
|---|---|---|
| Text Element | Used for adding text with dynamic data from JSON nodes, allowing inline merge fields within text. | {data.AccountName} |
| Field Element | Displays specific data fields directly from JSON; great for showing individual values in a structured format. | {data.Contact.Phone} |
| Action Element | Enables interactive actions (e.g., update, navigate) within FlexCards, and merge fields make actions context-specific by using unique identifiers. | URL action: /details/{data.Id} |
Step-by-Step Usage of Merge Fields in FlexCards
- Adding Merge Fields in Text Elements
Text elements are perfect for combining static text with dynamic data. Open the rich text editor in the Text element’s properties and input{data.FieldName}. This field will automatically pull and display data from the JSON node namedFieldName. - Using Field Elements for Direct Data Display
For showing individual data points, drag the Field element onto the canvas and set the field source. For example, entering{data.Contact.Email}directly displays a contact’s email address. - Creating Contextual Actions Using Merge Fields
Actions in FlexCards can use merge fields to make links or buttons dynamic. For instance, an Action button with/record/{data.Id}will navigate to a specific record page based on the current data’s ID, personalizing the link for each record displayed.
Best Practices
- Keep Field References Clear: Label JSON nodes clearly within Integration Procedures or DataRaptors for intuitive merge field referencing in FlexCards.
- Test in Sandbox: Verify merge field configurations in sandbox environments to ensure fields display data accurately and meet business requirements.
- Optimize for Performance: Only pull required fields into your JSON structure to improve performance, especially in complex FlexCards with multiple merge fields.
FlexCards in Salesforce OmniStudio leverage merge fields to display, interact, and act on data dynamically, enhancing the user experience and enabling data-driven decisions. This method simplifies the presentation of Salesforce data and ensures consistency across user interactions. For more detailed customization, refer to Salesforce’s Trailhead module on FlexCards.