Table of Contents
Conditions block II (with Dates, Usage and Agents variables)
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)
Date picker dates variables

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:


Time reference variables (today, yesterday, and tomorrow)
It detects the current day, the day before or after:


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)
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:

- 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:
- 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.