You are here:
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
| View supported editions. | |
This article applies to:
|
Enhanced WhatsApp channels |
This article doesn’t apply to:
|
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 |
| User Permissions Needed | |
|---|---|
| To create messaging components: | Customize Application AND View Setup and Configuration OR System Administrator |
| To send and receive messages in Messaging: | Messaging Agent |
Before you attempt to create something similar to this example, familiarize yourself with Meta’s Implement Endpoints for Flows documentation.
- Open the Flow format of an Apex-based form messaging component.
-
Fill in the Enable Endpoints section of the Initial Message.
- In the Enable Endpoint field, select True.
-
In the Endpoint URL field, enter your endpoint.

- To create a screen that asks the customer which body part is hurting, navigate to the Screens section and click + Add Screen.
- 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.
-
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.
- Under Field ID: Text, name it medical_need.
- Under Title: Text, add the question that presents to customers. Something like, Where are you experiencing pain?
- Under Options: Options Mode, select Static Options.
- Click Manage Options.
- Click + Add.
- Under Option 0, in the ID field, enter the internal ID for this field.
-
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.

- Click + Add to create menu selections for additional body parts that you have doctors for.
-
Save your changes.
At this stage, your form preview shows the Patient Intake screen with your single-select question and its body part options.

-
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?
- Click + Add Content, click to expand Other Content Types, select Footer, and click Done.
- Under Footer Button, in the Text field, enter Continue.
- In the Footer Action section, in the Footer Action field, select Data Exchange.
-
Click Configure Payload.
- Under Name, enter the Field ID of your single-select question. In this case, we named it medical_need.
- For Type, select Reference.
-
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/3eb8eb3a-db46-40a9-8283-4358b90dd2a8/support_channels/images/messaging/wa_endpoints_4.png)
-
Save your changes.
Now your screen preview shows the Continue button beneath your single-select question.

- 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.
- In the Flow Screen Title section, in the Text field, enter a header for this screen. We’ll call ours Doctor Preference.
- Under Screen Elements, click +Add Content, click to expand Selection, select Dropdown Selection, and click Done.
-
Click to expand Dropdown Selection.
- Under Field ID, in the Text field, name it doctor_list.
- Under Title, in the Text field, enter the command that the customer sees on the form. Something like, Select a Doctor.
- Under Options, in the Options Mode field, select Dynamic Reference.
- In the Select Array Field dropdown, select [Data] Doctor List - array.
-
Save your changes.
Your screen preview shows the Doctor Preference screen with a dropdown of doctors populated from your external data source.

- Continue to build the rest of your flow.
Did this article solve your issue?
Let us know so we can improve!


