Back to Help Home
Chatbots & AI

Using variables in chatbot responses

3 minutes read time Difficulty: intermediate

Using variables in chatbot responses

Variables let you store customer responses and use them later in the conversation.

What are variables?

Variables are named containers that hold data during a conversation:

  • {customer_name} — Stored from an Ask Question node
  • {order_id} — Stored from customer input
  • {api_result} — Stored from an HTTP Request response

Setting variables

From Ask Question node

  1. Add an Ask Question node
  2. In settings, set "Save response as": customer_name
  3. When customer answers, their response is stored

From Set Variable node

  1. Add a Set Variable node
  2. Set name: greeting value: Hello!
  3. Useful for computed values or flags

From HTTP Request

  1. Add an HTTP Request node
  2. Map response fields to variables
  3. e.g., order_status = response.data.status

Using variables in messages

Reference variables in any Send Message node:

Hi {customer_name}! Your order {order_id} status is: {order_status}

Built-in variables

VariableValue
{contact_name}Customer's name from contacts
{contact_phone}Customer's phone number
{current_time}Current time
{current_date}Current date

Tips

  1. Name clearlyorder_id not var1
  2. Set defaults — Handle cases where variable is empty
  3. Use in conditions — Branch based on variable values
  4. Don't overwrite — Use unique names for each piece of data

Was this guide helpful?

Your feedback helps us make these guides better for everyone.