Constructor Elements → Variables

Modified on Wed, 27 Aug at 2:54 PM

This instruction describes the elements of the script from the 'Variables' section used for bot actions.


  • Answer 

    This element sends a message with a question to the interlocutor and records their answer in a variable.

    • Time-based transition — specifies the time interval after which a transition or action will be performed if the user does not provide an answer within the specified time period.

    • Variable — selection of the variable where the answer will be recorded.

    • Answer format — selection of the answer format.

    • Text request — text message that will be sent to the user, the response to which will be recorded in the variable.

      *In this block, it is not required to surround the variable name with ${{ }} symbols.


  • Variable 

    Records a value in a variable. Similar to an assignment operator. 

    Global variable — switches the element's operation mode from interacting with local variables to interacting with global ones.

    Name — the name of the variable; if a variable with the specified name does not exist, it will create one.

    Value— data to be recorded in the variable.

    Additional options:

    Current time — records the current time in the variable.

    Actual date — records the current date in the variable.

    Random number — records a random number of the length specified in the Code Length field in the variable.

    *In this block, it is not required to surround the variable name with ${{ }} symbols.
     

  • Operation 

    Performs an arithmetic operation, recording the result in a variable.

    Name — название переменной в которую будет записан результат.

    Operand 1, Operand 2 — data (operands) with which the arithmetic operation is performed.

    Operation — function performed on the operands (in the upper right corner):

    • + — addition
    • - — subtraction
    • * — multiplication
    • / — division
    • Date concatenation — addition for variables storing dates.
  • *In this parameter, it is not required to surround the variable name with ${{ }} symbols.



  • Inclusion 

    Also known as the multiple choice operator, which sequentially checks for the presence of any of the values in the element in a variable. When these values match, the script execution continues along the corresponding arc.

    Similar to the Switch/Case construct (the bot checks the value and, depending on it, chooses one of the specified script branches), but instead of an operation, includes is used. 

    • Message text (Variable)text that will be checked for meeting conditions. If the user's text contains a word from the first line and simultaneously from the second line, the first line will be chosen as priority.

      Note:

      The field passes exactly the text that will be checked. That is, if you want to check the user's message, you need to use the scheme shown in the figure, saving the user's response in a variable.


    • Clarifying phrase — allows you to specify a condition or key phrase that initiates the inclusion of the corresponding external module, block, or other component in the chat bot's main script.

    • Comma separated values — phrases whose presence in the text will be checked. There can be several phrases, they should be specified separated by commas. The check is not case-sensitive.

    • Label name — this parameter defines the name or label for this element, which can be used to reference this included element or item in other parts of the script.


  • Condition 

    Checks if the condition specified in the element is met. If the condition is met, the script execution continues along the True branch, otherwise, along the False branch.

    Value 1 — the first parameter of the condition.

    Operation — the operand according to whose rules the condition is checked:

    • < — less than (True if Value 1 is less than Value 2). Strings are compared in alphabetical order.
    • = — equality (True if Value 1 equals Value 2).
    • Inclusion — (True if Value 1 contains Value 2). 
  • Such an expression will be true.

    Note:

    Variable values can also be compared with an empty field, thus checking whether they contain something or not. We compare the value of the variable name with emptiness. Is name empty? This way, the script will follow the True branch if name is empty (nothing is recorded in it), otherwise (the variable name contains some value) it follows the False branch.



Also see.:

Description of components of the Chatbots constructor

Chatbots

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article