---
schema_version: "1"
id: ea18d86b17fa6b63072a9ed9a35ab40b6423fd8138c8b9820ae788e9bab50e9c
title: Create a Dynamic WhatsApp Flow
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/messaging_whatsapp_create_dynamic_flows.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.messaging_whatsapp_create_dynamic_flows.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 2fc8038f56e49d8b7be7a0f49c7863c435a6dbfbbab5d1a2a77b676a29aa6c88
description: To create a dynamic WhatsApp Flow, create an Apex-based form messaging component and then add a Flow format to it.
products:
  - Service Cloud
  - Digital Engagement
release: "264"
---
# Create a Dynamic WhatsApp Flow

To create a dynamic WhatsApp Flow, create an Apex-based form messaging component and then add a Flow format to it.

### 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;">
            <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/checkmark.png" alt="Checkmark"></span>
            <strong>This article applies to:</strong>
          </td>

          <td class="slds-cell-wrap" style="vertical-align:top;">Enhanced WhatsApp channels</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;">Enhanced In-App Chat, Enhanced Web Chat v1, Enhanced Web Chat v2, Enhanced
            Facebook Messenger, Standard and Enhanced SMS, Enhanced Apple Messages for Business,
            Enhanced LINE, and Bring Your Own Channel</td>

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

To make the Flow dynamic, you can:

- Add dynamic references to set Flow properties based on conditions.
- Use If and Switch conditional logic to conditionally show screens and content within a screen.
- Add conditions based on any input data that the flow receives.

- **[Create a Form Based on an Apex Class](https://help.salesforce.com/s/articleView?id=service.messaging_whatsapp_create_form_apex_class.htm&release=264.0.0&type=5)**  
    Apex-based forms offer more flexibility than global action-based forms, enabling you to create both static and dynamic WhatsApp messages. To create an Apex-based form, create the Apex class, and then link it to a form messaging component. When the messaging end user submits their responses to the form, Salesforce executes the Apex, sending the data to Salesforce. You must configure how to save that data.
- **[Use Case: Use a Switch Element to Show Screens Based on Conditional Logic](https://help.salesforce.com/s/articleView?id=service.messaging_dynamic_whatsapp_flow_switch_element.htm&release=264.0.0&type=5)**  
    Use the Switch screen element to dynamically show or hide content. It compares a single field value against one or more specified values, and then displays the content associated with the first value that is an exact match. If no match is found, it returns the preconfigured default value. Unlike the If element, Switch is limited to performing an exact match comparison on a single field and doesn’t support complex logical operators like AND or OR.
- **[Use Case: Use If Condition to Show Content Based on Complex Logic](https://help.salesforce.com/s/articleView?id=service.messaging_dynamic_whatsapp_flow_if_element.htm&release=264.0.0&type=5)**  
    Use the If Condition screen element to dynamically show content or screens. For example, you can use the If Condition to add a footer that navigates to a different screen based on the previous selection. With the If Condition screen element, Salesforce evaluates one or more conditions in sequence and displays the content if the condition evaluates to true. If the condition is false, the logic returns the other preconfigured content. Unlike the Switch conditional logic, If Condition logic supports complex criteria by combining conditions using AND and OR logical operators.
- **[Use a Screen Flow to Pass Input Data to a Dynamic WhatsApp Flow](https://help.salesforce.com/s/articleView?id=service.messaging_dynamic_whatsapp_flow_input_data.htm&release=264.0.0&type=5)**  
    The screen flow can collect customer data and securely pass it into variables. These variables can then serve as input for the dynamic WhatsApp Flow that is created with an Apex-based form messaging component. To add personalized content to the message, in the Apex-based form messaging component, add dynamic references to this input data. For example, to schedule a veterinary appointment, the screen flow collects specific details, such as the type of animal and the issue, and dynamically passes this information to the Apex-based form messaging component.
- **[Use Case: Use an Endpoint to Populate a Screen with an External Data Source](https://help.salesforce.com/s/articleView?id=service.messaging_whatsapp_flow_endpoint_use_case.htm&release=264.0.0&type=5)**  
    An endpoint connects an external data source to your Apex form messaging component for dynamic WhatsApp Flows. Present information from an external source on a screen in a form. For example, a doctor’s office could create a form that asks a customer which body part hurts, and then present a list of doctors who specialize in that ailment.
- **[Considerations when Adding a Flow Format to a Form](https://help.salesforce.com/s/articleView?id=service.messaging_whatsapp_flow_form_considerations.htm&release=264.0.0&type=5)**  
    Keep these considerations in mind when you add a Flow format to a form messaging component.