---
schema_version: "1"
id: 6b611dc697f3b609a8c358652990edeae39c051680c3b8e74bbafa82dd55913b
title: Customizing Messaging Components with sObject Formulas
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/messaging_components_sobject_formulas.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.messaging_components_sobject_formulas.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 0d63d97a1fec05b1bef9be8f1c42a8a4211caec00e4947d376b191b23c68df85
description: Use sObject formulas to control the way that your messaging components appear in any non-Text format.
products:
  - Service Cloud
  - Digital Engagement
release: "264"
---
# 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

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
      <colgroup>
        <col style="width:50%">
        <col style="width:50%">
      </colgroup>
      <tbody>
        <tr class="">
          <td class="slds-cell-wrap" colspan="2" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.messaging_editions.htm&amp;type=5&amp;language=en_US" target="_blank">View supported editions.</a></td>

        </tr>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">
            <a name="messaging_components_sobject_formulas__d861e840"><!-- --></a><span style="vertical-align:text-bottom;display:inline-block;"><img style="margin-bottom:0;" id="messaging_components_sobject_formulas__d861e840" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/resources-global/_corporate/images/checkmark.png" alt="Checkmark"></span>
            <strong>This article applies to:</strong>
          </td>

          <td class="slds-cell-wrap" style="vertical-align:top;">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</td>

        </tr>
        <tr class="">
          <td class="slds-cell-wrap" style="vertical-align:top;">
            <span style="vertical-align:text-bottom;display:inline-block;"><img style="margin-bottom:0;" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/resources-global/_corporate/images/crossmark.png" alt="X icon"></span>
            <strong>This article doesn’t apply to:</strong>
          </td>

          <td class="slds-cell-wrap" style="vertical-align:top;">Standard and Enhanced SMS channels</td>

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

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/images/icon_tip.png)

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/images/icon_example.png)

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

#### See Also

- [Add Dynamic Images to Messaging Components](https://help.salesforce.com/s/articleView?id=service.messaging_components_images_dynamic.htm&release=264.0.0&type=5 "If you want a messaging component to show different images depending on the situation, define the images in the Messaging Component Builder by using parameters or sObject formulas. Adding dynamic images to messaging components is more advanced than adding static images, but it’s an effective way to personalize messages sent to customers.")