Customizing Messaging Components with sObject Formulas

Use sObject formulas to control the way that your messaging components appear in any non-Text format.

Required Editions

View supported editions.
Checkmark This article applies to: Enhanced In-App Chat, Enhanced Web Chat v1, Enhanced Web Chat v2, Enhanced WhatsApp, Enhanced Facebook Messenger, Enhanced Apple Messages for Business, Enhanced LINE, and Bring Your Own Channel
X icon This article doesn’t apply to: Standard and Enhanced SMS channels

While you can use formula templates to customize the Text format of messaging components, sObject formulas customize all other supported formats, such as Buttons, Card Carousel, List Selector, and Quick Replies. sObject formulas create values that are related to parameters of the RecordId type. For example, in a question component with dynamic options where each option references a record, use sObject formulas to create the values for the options’ titles or images.

sObject formulas in messaging components behave similarly as they do elsewhere in Salesforce, such as with custom formula fields. They can also reference any parameters and constants that have been autogenerated or manually added to the component. View a messaging component’s constants and parameters by opening the component in the Messaging Component Builder.

Tip
Tip A messaging component can have up to 5 custom parameters. To access more data while respecting this limit, try adding relationships between the MessagingSession object and other objects. Then, use merge fields in a formula to access data up to 3 levels deep. This example formula fetches a custom field value on a custom record that’s associated with a case, which in turn is associated with a messaging session: {!$Parameters.MessagingSession.Case.Custom_Record__c.CustomField__c}
Example
Example This sObject formula shows the title of a dynamic option for a list of case records. It consists of the case number, a dash, and the case subject: CaseNumber & “ - “ & Subject

Because the formula is specific to the case object and can’t be applied to other objects, it directly references case field names without adding the Case. prefix.

Here’s how a list item using this formula appears in a messaging session:

00001006 - Generator assembly instructions unclear