Objective
Learn about Bot Builder Conditions and Operations.
Applies To
- Jumper
- Bot Builder
Procedure
By adding Rules, you can define conditions and operations to your bot flow.
You can also set the Rule priority for each newly added rule, by defining a priority order.
To add a rule to your message template, click on Add a rule under Conditions:
Once you have added a rule, you can add conditions and operations to your rule, you can set multiple rules by adding new rules, to add a new rule simply click on the button + Add new rule.
Types of Conditions
Types of conditions that you can add to your rules are :
- Always true
- Check if name is valid
- Check if name is invalid
- Check if email is valid
- Check if email is invalid
- Check if mobile number is valid
- Check user input
- Check if bot variable has expected value
- Check if custom field and its value matches
- Check if CRM field does not exists for the customer
- Get all appointment bookings of a customer
- Check & cancel the selected booking
- Check if the user is subscribed to particular opt-in notification
- Check if the user is going through this bot again (repeated user)
- Generating a coupon code
- Check if coupon code distribution is active
- Check if coupon code distribution has ended
- Verify if coupon code is valid or not
Types of Operations
Types of Operations that you can add to your rules are :
- Save user response
- Add CRM tag
- Remove CRM tag
- Send standard purchase event to Facebook
- Send custom purchase event to Facebook
- Add Facebook custom event
- Add/update CRM field
- Remove CRM field
- Typing indicator
- Ping chat live agent
- Pass handover to another App (only for Facebook)
- Call 3rd party API
- Set appointment booking
- End this bot & connect to another bot
- End flow
Conditions
In all Message types, you can add Conditions to your message template simply by adding a new rule, there are several types of conditions that you can add to your message,
For e.g. - Checking if name, email, mobile number is valid or invalid, checking a user input, generating a coupon code, etc.
To add a Condition, you can find an option of Add a rule under the Conditions section, click on the Add a rule option to start adding conditions, for your message.
- Always true: Adding this condition will execute the added operations in the rule, even if the other conditions are not met.
- Check if name is valid: Checks if the entered email by the customer is valid.
- Check if name is invalid: Checks if the entered name by the customer is invalid.
- Check if email is valid: Checks if the entered email by the customer is valid.
- Check if email is invalid: Checks if the entered email by the customer is invalid.
- Check if mobile number is valid: Checks if entered number by the customer is valid.
- Check user input: Checks the customer’s response for the specified value or text.
- Check if bot variable has expected value: Checks if the bot has specified variable name & value.
- Check if custom field and its value matches: Checks if the mentioned field name & field value matches for the customer.
- Check if CRM field does not exists for the customer: Checks if the mentioned CRM field does not exist for the customer.
- Get all appointment bookings of a customer: This condition fetches all the booked appointment for the customer.
- Check & cancel the selected booking:Adding this condition will cancel the booked appointment & commit the changes for the booking.
- Check if the user is subscribed to particular opt-in notification: Checks if the user has subscribed to the specified opt-in notification template.
- Check if the user is going through this bot again (repeated user): Checks if the user is experiencing a repeated bot journey.
- Generating a coupon code: This condition generates the coupon code for the customer.
- Check if coupon code distribution is active: Checks if the coupon distribution date is still active.
- Check if coupon code distribution has ended: Checks if the coupon code distribution date has expired.
- Verify if coupon code is valid or not: This condition verifies if the coupon code is a valid one or not.
Operations
In all Message types, you can add Operations to your message template by adding a new rule, there are several types of operations that you can perform eg - Save user response, Add CRM tag, Remove CRM tag, Add Facebook custom event (for messenger), Add/update CRM field, Remove CRM field, Typing indicator, Ping, chat live agent, End flow.
To add operations you will find Add a rule button on all message templates, click on it.
Here you will get to add conditions, operations and set Rule priorities, select the option + Add operation, then select the operation you need to add.
- Save user response: In this operation you can save the user’s input (response) in form of a variable (data) in a conversation flow.
To add this operation simply select the Save user response option under operations, a default variable name is set which you can edit to store user’s response, once you have defined the variable name, click on save.
Note: Refrain from using common words(e.g. have, hi, you, etc.) for a variable name, check with our team for any further queries. - Add CRM tag: In this operation you can add a tag for the message template, which will appear on the CRM tags of the customer once the operation is performed.
To add this operation select the Add CRM tag option in the operations, then enter the tag you want to add for your customer and click on the save button. - Remove CRM tag: This operation is used to remove tags from the existing CRM tags for a customer.
To add this operation select the Remove CRM tag option in the operations, then enter the tag you want to remove and click on save. - Send standard purchase event to Facebook:This operation is used to send the standard purchase event to Facebook.
- Send custom purchase event to Facebook:This operation is used to send the custom purchase event to Facebook.
- Add Facebook custom event:By adding this operation, you can specify your Facebook custom event for the current flow.
- Add/update CRM field: This operation is used to add/update CRM field for the message template, which will appear on the CRM fields list of the user once the operation is performed. To add this operation select the Add/update CRM field option in the operations, then enter the field name and field value you want to add and click on save.
- Remove CRM field: This operation is used to remove a CRM field from the added CRM fields for the message template, which will remove the field on the CRM field for the user once the operation is performed. To add this operation select the Remove CRM field option in the operations, then enter the field name and field value you want to remove and click on save.
- Typing indicator: This operation is used to indicate a typing response to the user. To add the operation select the Typing indicator option and select the number of seconds you want to show the indicator to the user between 1 to 10 in the dropdown, then click on save. (maximum limit for the indicator in 10 seconds.)
- Ping chat live agent: This operation is used to trigger a Live chat agent in the message template, to add the operation select the option Ping chat live agent, enter the agent/group name which you have added and click on save.
Note: Make sure you have added an agent to your Live chat before adding this operation. - Pass handover to another App (only for Facebook):In this operation, you can hand over the recurring conversation to another app, by specifying the ID for the App & the data that need to be passed to App while handing over the conversation based on your current flow.
- Call 3rd party API:In this operation, you can call an external API using GET & POST methods using request URL. To know more about Calling 3rd party API visit here.
- Set appointment booking:This operation is used to set appointment booking in a bot flow. Contact our support for more info about setting up appointment booking.
- End this bot & connect to another bot: This operation is used to end the current bot flow and connect it with another bot. To add this operation select the End this bot & connect to another bot option, you will see a dropdown to select from the listed bots.
Note: Refrain from deleting any other elements added with this step as it will effect your bot flow. - End flow: This operation is used to define the end of the flow for the message template. To add this operation select End flow option and click on save.
Articles in this section
- How to Send Personalised Media Messages Using Message Variables in the Bot Builder
- Create Subscribe, Unsubscribe and Re-Subscribe Bots for WhatsApp
- Bot Builder - How to view & extract Bot data ?
- Bot Builder - Custom Payload as a bot trigger
- Bot Builder - Organizing your Bots by creating Folders
- Bot Builder - How to Set a Bot on Autostart?
- Bot Builder - Settings overview
- Bot Builder - How to Test your Bot
- Bot Builder - How To End your Bot
- Bot Builder - Rules (Conditions & Operations)