---
schema_version: "1"
id: f85453094a2ec598a7a526669f652c49c054de326bdb89ce7a8fae252b777db2
title: Add Dynamic Content to Messaging Components
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/messaging_components_formulas.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.messaging_components_formulas.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: c527be0d8d5285119f32ebc1b3f011269411abe583a31c336d0b25183fe4b7ee
description: When you create messaging components for service reps to use in enhanced Messaging channels or Enhanced Chat, you can use formulas to add dynamic, session-specific content to the component.
products:
  - Service Cloud
  - Digital Engagement
release: "264"
---
# Add Dynamic Content to Messaging Components

When you create messaging components for service reps to use in enhanced Messaging channels or Enhanced Chat, you can use formulas to add dynamic, session-specific content to the component.

### 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_formulas__d915e840"><!-- --></a><span style="vertical-align:text-bottom;display:inline-block;"><img style="margin-bottom:0;" id="messaging_components_formulas__d915e840" 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>

Formulas fall into two categories: formula templates and sObject formulas. You can use both to customize different parts of a messaging component.

- Formula templates consist of a text body with possible merge fields. When a message that includes a formula template is sent, the merge fields are replaced with contextual information such as an order number or customer name. Use formula templates to customize the Text version of a messaging component.
- sObject formulas are object-specific formulas that create field values based on contextual data. Use sObject formulas to customize any supported format of a messaging component except for Text.

Formula templates and sObject formulas can contain both plain text and contextual data from a data source. Two types of data sources are supported: constants and parameters.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
      <colgroup>
        <col style="width:33.33333333333333%">
        <col style="width:33.33333333333333%">
        <col style="width:33.33333333333333%">
      </colgroup>
      <thead class="slds-text-title_caps ">
        <tr class="">
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d64830e117">
            <strong>Data Source</strong>
          </th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d64830e123">
            <strong>Definition</strong>
          </th>
          <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d64830e129">
            <strong>How to Reference</strong>
          </th>
        </tr>
      </thead>
      <tbody>
        <tr class="">
          <td data-label="Data Source" class="slds-cell-wrap" style="vertical-align:top;" headers="d64830e117 ">Constant</td>

          <td data-label="Definition" class="slds-cell-wrap" style="vertical-align:top;" headers="d64830e123 ">Metadata that is defined as part of the messaging component. Constants support
            multiple data types, including text, URL, and image.</td>

          <td data-label="How to Reference" class="slds-cell-wrap" style="vertical-align:top;" headers="d64830e129 ">
            <p>
              <code>$Constants.&lt;constant_name&gt;</code>
            </p>
            <p style="margin-bottom:0;">In this syntax, replace <code>&lt;constant_name&gt;</code>
              with the name of a constant. For example: <code>$Constants.Title</code></p>
          </td>

        </tr>
        <tr class="">
          <td data-label="Data Source" class="slds-cell-wrap" style="vertical-align:top;" headers="d64830e117 ">Parameter</td>

          <td data-label="Definition" class="slds-cell-wrap" style="vertical-align:top;" headers="d64830e123 ">Metadata that is defined as part of the messaging component, with the data that
            it contains provided dynamically when a message is rendered. Parameters support the
            same data types as constants and references to records such as cases or
            products.</td>

          <td data-label="How to Reference" class="slds-cell-wrap" style="vertical-align:top;" headers="d64830e129 ">
            <p>
              <code>$Parameters.&lt;parameter_name&gt;</code>
            </p>
            <p style="margin-bottom:0;"> In this
              syntax, replace <code>&lt;parameter_name&gt;</code> with the
              name of a parameter. For example: <code>$Parameters.MyCaseParam</code></p>
          </td>

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

- **[Customizing Messaging Components with Formula Templates](https://help.salesforce.com/s/articleView?id=service.messaging_components_formula_templates.htm&release=264.0.0&type=5)**  
    When you create a messaging component, you can add and configure one or more formats to control the component’s appearance in different Messaging channels. The default format of messaging components is Text, which is a plain text version of the component.
- **[Customizing Messaging Components with sObject Formulas](https://help.salesforce.com/s/articleView?id=service.messaging_components_sobject_formulas.htm&release=264.0.0&type=5)**  
    Use sObject formulas to control the way that your messaging components appear in any non-Text format.
- **[Supported Functions in Messaging Component Formulas](https://help.salesforce.com/s/articleView?id=service.messaging_components_formula_functions.htm&release=264.0.0&type=5)**  
    Before you customize components in the Messaging Component Builder, review which functions are and aren’t supported.