Table of Contents

Conditions block II (with Dates, Usage and Agents variables)

Pau Sanchez Updated by Pau Sanchez

Conditions with Dates

Sometimes we need to set up conditions to split our flow depending on dates. In this case, there are four types of date variables:

For Landbot (Web)

  1. Date picker dates variables

Warning: Dates can be picked in different formats, but the only format that will work with the Conditions block is YYYY-MM-DD or YYYY/MM/DD.

  1. Usage details variables (created, last seen)

If the user did not cancel his/her cookies, according to the id it will be possible to detect when it was created and when it was the last day the user used the bot:

  1. Time reference variables (today, yesterday, and tomorrow)

It detects the current day, the day before or after:

  1. Custom variables (from a webhook, set variable, integration or user input)

Sometimes we pull information from outside sources or maybe we need to the user to add it, for example with a button:

Conditions with Dates (Greater and Smaller)
Warning: Dates can be picked in different formats, but the only format that will work with the Conditions block is YYYY-MM-DD or YYYY/MM/DD.

In the example above we are comparing strings, so the text must be equal. But in case to compare if a date is greater or smaller, this will be the set up:

  1. After the date picker we need to create a Set Variable block, where we are going to set a new variable with the date that we want, and very important, must be set up in DATE format:

  1. After we can add the Conditional block, where we are going to compare the date selected in the Date Picker, and the date we set up in the Set Variable block

Conditions with Usage (browser information)

URL

This is the URL that contains the Bot, where is embedded

country

Country where the bot is being used (not always available)

Browser/navigator, Device, and OS

Information related to the system used by the bot visitor. More information about it in this link

Conditions with Agents (online or offline)

Agents Online

This is the easiest solution to split the conversation to an agent only if there is any online. If there is anyone online, it will be True, then Green output, otherwise it will be False and Red output.

For WhatsApp

This block behaves exactly the same way as in the landbot (web) version.

For Facebook Messenger

This block behaves exactly the same way as in the landbot (web) version.

How did we do?

Conditions block

How to ask a question based on a variable not being set (empty URL params)

Contact