Assign a value to a variable

The Set feature allows us to create as well as modify a variable.

If the concept of a variable is totally abstract for you, I advise you to consult the following article before continuing: All about {{…}} variables.

1. Use

Among the construction features, click on “Variables” and then, in the menu that opens, click on “Set”.

Set feature - Icon

Let’s start by creating a Set feature:

Set feature

You have 2 choices:

  • Choose an existing variable from the drop-down list to modify it.
  • Create a variable by inserting the name of the new variable.

All you have to do is insert the value to be assigned to the variable.
When the bot performs this function, it will be completely invisible to the user.

It is also possible to give the variable the value of another existing variable by clicking on the icon {…}

We have created a variable with the name“myVariable” and the value“5”:

Set feature

Let’s check that the operation works by asking the bot to display the value of the variable myVariable.

Set feature

Let’s run the bot to see the result:

It is confirmed, our variable “myVariable” has the value 5. We can now manipulate it from any sequence in our bot.

TIP
To reset a variable already filled to 0, just put the name of the variable and as value put empty.

2. Options

A – You can leave a comment to your collaborators about this feature by clicking on the icon (see below).
View Article : Add Comments

Comment

B – By clicking on the “?” icon, the online help will open on the article corresponding to this functionality.

Feature online help

C – You can duplicate, delete or move this feature by using the icons that appear on the hover.

Move, duplicate and delete a feature

Create your Chatbot Easily and for Free!