How can we help?
< All Topics
Print

Dynamic Variables

In programming, a dynamic variable is a variable whose value is determined by the user when the program is run.

In botbaba, a user’s input (response or message) can be stored in a dynamic variable which can then be recalled when required anywhere in the chat flow.

How to use Dynamic Variable?

  1. Declare a variable
  2. Recall a variable

Let’s start by declaring a dynamic variable:

After opening your Bot, go to Edit the block and you will see screen like this

You can now see the box asking you to enter the name of your dynamic variable.

Here, we are taking example of contact number so we can name the dynamic variable as “number”.

Now, let’s recall this variable in next block

The number which was given as response in the previous block will now be recalled for confirmation in this block.

To recall a particular variable, use #variable# in any of the bot messages.

I have recalled the mobile number collected in the next block by writing #number# in the next message. My message was Confirmation: Your contact number is #number#

and the output will look like this:

You can use variables (dynamic or global) anywhere on our platform wherever you see this icon in a text box =>

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Previous Global Variables
Next How to apply a template to your bot?
Table of Contents