Connection with a trigger

The trigger field

This field specifies the trigger for transitioning to another block.

If the Trigger field in the connection is left empty, the transition will occur on any word or phrase from the user.

Connection triggers

An connection with a trigger is a connection that activates a transition only if a certain trigger is met.

The connections's triggers can be set:

  • By a certain word (callback) — specified in the Trigger field. For example, when the NO button is pressed, the bot replies with "Have a nice day!". You can read more about this here. At the same time, words (callbacks) that the arrow should ignore can be specified (mostly used when the Trigger field is empty).

  • By analyzing variable values — specified in the Variable field. You can read more about this here.

Additionally, it is possible to create keyboard (reply) buttons. To do this, simply enter the button text in the Trigger field and enable the Display as button toggle.

You can also specify a check for user input in the connection trigger using regular expressions:

You can also use a variable for comparison:

However, according to the syntax rules, you cannot specify multiple comparison triggers for the same variable in a single trigger.

If you need to check multiple values in a condition, use the operators and (&&), or (||), and others.

Match type

By default, "Fuzzy match" is selected.

In MaviBot, there are five types of trigger matching:

  1. Fuzzy match; The condition will be checked for partial matches with the user’s input. This means that if the user enters a word or phrase with mistakes or different endings, the condition will still trigger.

  2. Keyword match; If this option is selected, the transition will trigger if the user’s response contains at least one keyword from the "Trigger" field.

  3. RegEx match; The condition checks the user’s response against the regular expression you specify.

  4. Exact match; This condition checks the word or phrase for an exact match, without errors or modifications.

  5. Semantic search. This is the smart search for semantic in a client message with AI.

For example: validating phone number format, email, input of digits only, etc. You can read more about regular expressions here.

Advanced connection settings

To open the Advanced settings, click on "Advanced settings" below the Match type field, as shown in the image below.

Ignore triggers

Enter the "negative words" here — words or phrases that the bot should not respond to when checking the trigger.

Variable

The variable for comparison works together with the trigger or the "Ignore triggers" stroke. That is, both the trigger and the trigger in the variable must be met.

If you specify only the variable name in the comparison variable field, without an expression, the condition will be compared with the variable’s value instead of the user’s input.

In the example shown in the image below, the transition will occur if the value of the "AGE"variable:

The example created four blocks:

  1. A Start block for entering the bot: this block asks the client's age.

  2. A second block with a connection that collects the client's data into a variable (this variable will help route the client through the funnel).

  3. Two blocks connected to the previous block:

    • If the client is over 18, the message "The second message" will be sent.

    • If the client is under 18, the message "I'm sorry, you can't text to the bot" will be sent.

Step 1. Create four blocks.

Step 2. Connect the "Start" block to the second "Chat" block.

Step 3. Go to the connection settings and activate the "Data collection" checkbox.

Step 4. Enter the variable in the "Input data" field and save the connection settings.

Step 5. Connect the second block to the remaining blocks.

Step 6. Go to the connection settings and enter 'age ≥ 18' in the "Variable" field.

Step 7. Set the timer to "0 seconds" on the same connector.

Step 8. Set the value to "age < 18", and configure the connector similarly to the previous one.

Priority

By default, the priority value is set to 10. The higher the priority of the condition, the earlier it will be checked.

Callback-Only trigger

If this toggle is activated, the client will only proceed to the next block connected by the arrow if a callback is received by the system.

Last updated