Links
Comment on page

Set Variables

Platform allows you to set variables, which can be used inside your chatbot to check a condition, form a message, or by another embedded function
ctx.setVar(variableName, variableType, variableValue)
e.g. ctx.setVar("@visitor_first_name", "Text", "Developer")
Parameters
Description
variableName
Name of a variable
Variable Name cannot has spaces, and must start with an alphabet
@VariableName : Save variable in visitor information (e.g. First Name, Email etc), which almost never changes for a visitor
#VariableName : Save variable in session, and will reset automatically when the visitor visits next time
variableType
Allowed Types
  • Text
  • Boolean
  • Date
  • Number
  • Decimal
  • Object
variableValue
Any value as per the variable type