Ellyn / November 8, 2021
A Set Variable command allows you to specify the value of a variable.
Adding a Set Variable command node #
Step 1: #
Add a New Command node by clicking on the last node to access the contextual menu and choose “New Command” to open up the Edit form.
![](https://blog.querlo.com/wp-content/uploads/2021/10/Command-ode-new-3.jpg)
Step 2: #
This is the “Edit” form where you can modify the content of this node.
(Q1): Command Type. Choose “Set Variable” for this command node.
(Q2): Variable Name. Enter a name for the variable you wish to set.
(Q3): Variable Value. The value the variable should assume. It can also be compounded with other variables. I.E. “New value is {anotherVar}”
(Q4): Add a Label. Labels are used to reference nodes in various functions of the chat builder.
(Q5): Save.
![](https://blog.querlo.com/wp-content/uploads/2020/02/3.1.6.10-set-variable02-1.jpg)
Example #
Step 1: #
After opening the new command dialogue, fill the form as per the screenshot below and click save.
![](https://blog.querlo.com/wp-content/uploads/2020/02/3.1.6.10-set-variable03A.jpg)
Step 2: #
The Set Variable Command node in the Chat Builder.
![](https://blog.querlo.com/wp-content/uploads/2020/01/3.13.10-set-variable02-1-1024x611.jpg)
Set Variable & Conditional Branch #
A Set Variable Command node may be used together with a Conditional Branch Question node. Please read Conditional Branch to learn more.