Available variables are predefined values you can reference when building flows. You can also create, insert, and delete custom variables.
Before you begin
Open a flow and select a component to access available variables.
-
Log on to the Chat App Message Service console.
-
On the page, click the name of the Flow Name you want to edit to open it on the canvas.
-
On the canvas, click the target component. Its configuration panel appears on the right, showing the Available Variables section.
For example, selecting the Send a WhatsApp Message node displays predefined variables such as
incomingMessage,serviceId, andcustomerPhoneNumber.NoteFlows with a WhatsApp, Instagram, or Messenger trigger have built-in default variables. For manually triggered flows, click the Start node and add variables in the Basic Settings section to accept parameters at runtime.
Default variables
|
Parameter |
Description |
Example |
|
incomingMessageType |
Type of the incoming message. |
|
|
incomingMessage |
First incoming message from the end user. |
Hello |
|
wabaId |
WhatsApp Business Account (WABA) ID. |
10***********23 |
|
wabaPhoneNumber |
Phone number associated with the WABA. |
861301111**** |
|
customerPhoneNumber |
End user's phone number. |
861310000**** |
|
customerName |
End user's name. |
John |
Create a variable
Create variables using any of the following methods. First, complete the steps in Before you begin.
Set Variables component
-
From the Component Library on the left, drag the Set Variables component onto the canvas.
-
Click the Set Variables component on the canvas. Its configuration panel opens on the right.
-
To add multiple variables, click Add Variable. When you are finished, click Save.
In the Variable Configuration section, enter the Key and Value.
-
In the dialog box that appears, click Save.
On-the-fly creation
-
On the canvas, click a component such as Send a Viber Message or Send an Instagram Message. In the Message Settings panel, type
{{in the Content field to open a dropdown. Select an existing variable or type a new name to create one. The list includes variables such aschatFlowSessionId,incomingOutId, andincomingUuid. Click Save. In the dialog box that appears, click Save again.
Start node (manual triggers only)
On the canvas, click the Start node. In the Basic Settings panel on the right, turn off the Do Not Accept Incoming Variables switch. In the Variable Name field, enter the name for the new variable.
To add more variables, click Add Variable. After you add all the variables, click Save.
In the dialog box that appears, click Save.
Insert a variable
To insert a variable, first complete the steps in Before you begin.
In a component's configuration area, such as the Content field in the Message Settings panel, type
{{to open a variable dropdown. Select an existing variable from the list, which includes options likechatFlowSessionId,incomingOutId, andincomingUuid.
Delete a variable
Delete variables using the method that matches how they were created. First, complete the steps in Before you begin.
You can only delete a variable from the component where it was created. You cannot delete a System Variable. Deleting a variable may cause errors in other parts of the flow that reference it.
Set Variables component
On the canvas, click the Set Variables component. In the configuration panel, find the variable to remove and click Delete.
NoteIf the variable was created via insertion in the Set Variables component, click the variable, and then click Delete in the confirmation dialog that appears.
After deleting, click Save at the top of the canvas.
In the dialog box that appears, click Save to confirm.
Start node (manual triggers only)
On the canvas, click the Start node. In the configuration panel, click the delete icon next to the variable to remove.
After you delete the variable, click Save.
In the dialog box that appears, click Save to confirm.