---
schema_version: "1"
id: 9ed04f2355c21ead372b2be588de5c0414e8e085efefc6b2f2ccc17299591142
title: "Use Case: Use an Endpoint to Populate a Screen with an External Data Source"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/messaging_whatsapp_flow_endpoint_use_case.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.messaging_whatsapp_flow_endpoint_use_case.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 4a4d64cf845d150b4b7f3a9c4528f02547877ad4f6866c8a69a55816909d4ab8
description: 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.
products:
  - Service Cloud
  - Digital Engagement
release: "264"
---
# Use Case: Use an Endpoint to Populate a Screen with an External Data Source

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.

### 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> <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d34408e94">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d34408e94 ">To create messaging components: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d34408e94 ">
              <p>Customize Application AND View Setup and Configuration</p>
              <p>OR</p>
              <p style="margin-bottom:0;">System Administrator</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d34408e94 ">To send and receive messages in Messaging: </td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d34408e94 ">Messaging Agent</td>

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

Before you attempt to create something similar to this example, familiarize yourself with Meta’s Implement Endpoints for Flows documentation.

1. Open the Flow format of an Apex-based form messaging component.
2. Fill in the Enable Endpoints section of the Initial Message.
    1. In the Enable Endpoint field, select **True**.
    2. In the Endpoint URL field, enter your endpoint.
        
        ![Enable Endpoints section filled out with Enable Endpoint set to True, and URL populated in the Endpoint URL field.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/support_channels/images/messaging/wa_endpoints_1.png)
3. To create a screen that asks the customer which body part is hurting, navigate to the Screens section and click **\+ Add Screen**.
4. Under Flow Screen Title, in the Text field, enter the title that customers see at the top of this screen in the flow. In this example, we’ll enter **Patient Intake**.
5. Click **+Add Content**, click to expand the Selection list, and then select **Single-Select Question**. Click **Done**.
    
    This Single-Select Question screen element lets you create a list of body parts for a customer to choose from. Based on their selection from that list, you’ll present a list of compatible doctors on the following screen. Click to expand the Single-Select Question element, and fill in its fields.
    
    1. Under Field ID: Text, name it **medical\_need**.
    2. Under Title: Text, add the question that presents to customers. Something like, **Where are you experiencing pain?**
    3. Under Options: Options Mode, select **Static Options**.
    4. Click **Manage Options**.
    5. Click **\+ Add**.
    6. Under Option 0, in the ID field, enter the internal ID for this field.
    7. In the Label field, select **Literal**, and enter a body part that your doctor practice can treat, such as **Arm**, in the field below it.
        
        ![The Manage Options modal expanded with menu selections filled out. ID and Label text fields are both set to the word Arm, which is a possible menu selection.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/support_channels/images/messaging/wa_endpoints_2.png)
    8. Click **\+ Add** to create menu selections for additional body parts that you have doctors for.
6. Save your changes.
    
    At this stage, your form preview shows the Patient Intake screen with your single-select question and its body part options.
    
    ![Screen preview showing the Flow Screen Title, the question Title, and two single-select menu options.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/support_channels/images/messaging/wa_endpoints_3.png)
7. Back under Screen Elements for the same screen, click to minimize the Single-Select Question element that you just created.
    
    In this next step, create the button that a customer clicks to confirm their answer to the question Where are you experiencing pain?
8. Click **\+ Add Content**, click to expand Other Content Types, select **Footer**, and click **Done**.
9. Under Footer Button, in the Text field, enter **Continue**.
10. In the Footer Action section, in the Footer Action field, select **Data Exchange**.
11. Click **Configure Payload**.
    1. Under Name, enter the Field ID of your single-select question. In this case, we named it **medical\_need**.
    2. For Type, select **Reference**.
    3. For Value, select **\[Input\] Patient Intake - medical\_need**.
        
        ![Data Exchange Payload modal window expanded. Name is set to medical\_need, and Value is selected as \[Input\] Patient Intake - medical\_need.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/support_channels/images/messaging/wa_endpoints_4.png)
12. Save your changes.
    
    Now your screen preview shows the Continue button beneath your single-select question.
    
    ![Screen preview with the addition of the Continue footer button.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/support_channels/images/messaging/wa_endpoints_5.png)
13. To create a new screen that presents a list of doctors from the endpoint’s database based on the selection that your customer makes in the previous screen, click **\+ Add Screen**.
14. In the Flow Screen Title section, in the Text field, enter a header for this screen. We’ll call ours **Doctor Preference**.
15. Under Screen Elements, click **+Add Content**, click to expand Selection, select **Dropdown Selection**, and click **Done**.
16. Click to expand Dropdown Selection.
    1. Under Field ID, in the Text field, name it **doctor\_list**.
    2. Under Title, in the Text field, enter the command that the customer sees on the form. Something like, **Select a Doctor**.
    3. Under Options, in the Options Mode field, select **Dynamic Reference**.
    4. In the Select Array Field dropdown, select **\[Data\] Doctor List - array**.
17. Save your changes.
    
    Your screen preview shows the Doctor Preference screen with a dropdown of doctors populated from your external data source.
    
    ![Screen preview with Flow Screen Title set to Doctor Preference, dropdown field title set to Select a Doctor, and the dynamic reference dropdown field set to an array.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/support_channels/images/messaging/wa_endpoints_6.png)
18. Continue to build the rest of your flow.