Use available variables

更新时间:
复制 MD 格式

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.

  1. Log on to the Chat App Message Service console.

  2. On the Flow Management > Chat Flow page, click the name of the Flow Name you want to edit to open it on the canvas.

  3. 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, and customerPhoneNumber.

    Note

    Flows 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.

text, location, button, interactive

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

  1. From the Component Library on the left, drag the Set Variables component onto the canvas.

  2. Click the Set Variables component on the canvas. Its configuration panel opens on the right.

  3. To add multiple variables, click Add Variable. When you are finished, click Save.

    In the Variable Configuration section, enter the Key and Value.

  4. In the dialog box that appears, click Save.

On-the-fly creation

  1. 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 as chatFlowSessionId, incomingOutId, and incomingUuid.

  2. Click Save. In the dialog box that appears, click Save again.

Start node (manual triggers only)

  1. 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.

  2. To add more variables, click Add Variable. After you add all the variables, click Save.

  3. 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 like chatFlowSessionId, incomingOutId, and incomingUuid.

Delete a variable

Delete variables using the method that matches how they were created. First, complete the steps in Before you begin.

Important

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

  1. On the canvas, click the Set Variables component. In the configuration panel, find the variable to remove and click Delete.

    Note

    If 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.

  2. In the dialog box that appears, click Save to confirm.

Start node (manual triggers only)

  1. 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.

  2. In the dialog box that appears, click Save to confirm.