Skip to main content

Conversation Element "Set value of a variable"

 This conversation element lets you change the value of the variable

You can only set the value of these variables:

  1. User variables that are defined within a conversation by using "Save user input."
  2. System variable "_UserRegister1".


Why modify the value of a variable?

There can be various reasons for modifying the value of a variable. let's say you have declared a variable named "location" by creating the conversation element "Save user input". However, you do not want to ask the end-user for location every time. You can achieve this by setting the value of the variable "_UserRegister1" to "LocationProvided". Now you can put validation criteria to check if the value of _"UserRegister1" is equal to "LocationProvided". If true, then don't ask for location. 


How to configure this element?

  1. Log into repliedAI console click here.
  2. Navigate to the "My bots" section. 
    Create your bot

  3. If you have not created any bot yet, follow this tutorial to create your first bot click here. If you already have a bot then go to the bot design studio by clicking on this button. 

  4. Once you are in the bot design studio, add conversation Element "Set value of a variable" into your chatbot design.
    Set Value of a variable

  5. Click on the cog icon over the "Set value of a variable" conversation element, this will take you to the conversation element settings page
    Settings button

  6. On the settings page, type in the required information:
    • Variable name: Select the variable whose value you want to change. You can only choose user-defined variables.
    • Variable value: Type in the new value for that variable. 
    • Data Retained For Type the number of days up to when you want the data to be retained. e.g. if you type 1, then the data will be retained for 1 day.
      Settings

Comments