Konverse AI Developer Hub
  • Konverse AI Developer Hub
  • Getting Started
    • Authentication
    • Errors
    • Rate Limit
  • Webhooks
    • Webhook Endpoints
  • Platform
    • Embedded Functions
      • Send Text Message
      • Send Quick Reply
      • Set Variables
      • Send Choice
      • Send Cards
      • Stop Propagation
      • Query a Dataset
      • Jump To Story
      • Query a Google Sheet
    • Datasets
    • Bot Webhooks
  • Messaging Channels
    • Introduction to Channels
    • Web Chat
    • Facebook Messenger
    • WhatsApp
      • Send WhatsApp Notifications
      • Send Session Message
    • Line
  • App Integration
    • Android App Integration
Powered by GitBook
On this page

Was this helpful?

  1. Platform
  2. Embedded Functions

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

PreviousSend Quick ReplyNextSend Choice

Last updated 3 years ago

Was this helpful?