Variables

Variables are reusable objects containing a user-submitted value.

Variables are essential for capturing and utilizing the data dynamically in the conversation. With variables, you can personalize the chat experience by being able to say “Hey Hardik!”, instead of “Hey there!”.

Kinds of variables:

  • System variable - Created by default by WotNot. Contains things like city, country, os etc.

  • Contact variable - Stores the value in the variable for recurring conversations. Usually used for collecting names, email etc.

  • Conversation variable - Stores the value in the variable for that conversation only.

Creating variables

You can create variables from two places:

1 - From the variable list

Under Settings > Variables, you will find all the variables in your workspace. You can click “Create” to create a new variable and provide the details like - name, description and type.

2 - From the bot builder

In action blocks that allow you save user input like “Collect Input”, “Buttons” etc. you have the option to create a new variable.

First, you choose the type of variable, next you provide the details like name, description, type.

Editing variables

Go to Settings > Variables > Click “Edit” on the variable.

You will be only allowed to edit the description and data type.

Deleting variables

Variables can only be archived and not deleted.

Go to Settings > Variables and click “Archive” on the variable you want to archive.

Using a variable

You can invoke a variable by typing # to preview the variable dropdown across the bot builder.

Data type in variables

You can store the following type of data in variables:

Data typeDescription

Text

Stores any text input.

Number

Stores only numeric digits from 0 to 9.

Boolean

Stores only 0, 1, true, false.

Date

Stores date formats as DD/MM/YYYY and MM/DD/YYYY

Email

Stores email addresses.

Phone

Stores phone numbers.

Regex

Stores input based on your validation rule.

System variables offered

Here are the system variables offered by default:

VariableDescription

name

Name of the visitor

email

Email of the visitor

phone

Phone number of the visitor

ip_address

IP address of the visitor

city

City detected through the IP address of the visitor

state

State detected through the IP address of the visitor

zipcode

Zipcode detected through the IP address of the visitor

country

Country detected through the IP address of the visitor

timezone

Browser timezone of the visitor

os

System OS of the visitor

referrer_url

Referrer domain to the visitor.

unsubscribed_phone_numbers

Whether the phone number is unsubscribed from outbound messaging.

utm_source

Utm source

utm_medium

Utm medium

utm_campaign

Utm campaign

utm_content

Utm content

utm_term

Utm term

browser

Browser used during the chat

contact_id

bot

Name of the bot the visitor interacted with.

browser_language

Language set in the browser.

browser

Name of the browser.

channel

Name of the channel where the chat took place.

contact_created_by

Who created the contact.

conversation_url

Link to the conversation.

country_code

ISO country code of the country where the chat originated from.

created_at

Date when the chat was created.

gcal_selected_slot_day

Selected day when booking the meeting on Google Calendar.

gcal_selected_slot_time

Selected time when booking the meeting on Google Calendar.

timezone

Timezone of the device.

url

URL of the webpage where the user is interacting with the bot.

Best practices for variable management

  • Use descriptive names: Choose variable names that clearly reflect the data they hold, such as "userEmail" or "orderTotal".

  • Document purposefully: Write clear descriptions that explain the variable's role within your AI agent's workflow.

  • Maintain consistency: Use a consistent naming convention for your variables to make them easily identifiable and manageable.

  • Regularly review and refine: As your AI agent evolves, revisit your variables to see if they still serve their intended purpose or need adjustments.

Last updated