Table of Contents

Conditions block: check dates, visitors and team members online

Desirée M Updated by Desirée M

The Conditions block can check dates and the details Landbot saves about every visit, such as when the visitor first came, which page they're on and whether anyone from your team is online. Each check leads the conversation down the green output (true) or the red output (false). That's how an agent greets a returning visitor differently, catches a same-day booking or offers a person only when someone can answer.

These details are system Fields. Landbot fills them in on its own, so your agent never has to ask for them. Each one is explained in full in Landbot System Fields.

Which system Fields can a Conditions block check?

A Conditions block can check every system Field listed under Usage details and Time references. You pick them like any other Field, from the IF box or Use field in the Conditions panel. Here's what each one holds:

● Yesterday, Today and Tomorrow: the dates around the moment the condition runs, in Central European Time (CET).

● Created and Last seen: the date the visitor first chatted with the agent and the date of their last visit. Both follow the visitor ID, which depends on the agent's Second visit settings.

● Url: the page the visitor is chatting on. On your website, that's the page the agent is embedded in; when visitors open the agent's own link, it's that link.

● Country, Browser, Device and OS: where the visitor is and what they're chatting on, when Landbot can detect it, for example Spain, Chrome Mobile and Android.

● Team members online: true when at least one person on your team is online.

● Chat transcription: a transcript of the conversation so far, with each message from the agent and the visitor, its date and time, and who sent it.

Use field list in a Conditions panel showing the Usage details Fields Team members online, Last seen, Created and Url
Use field list in a Conditions panel showing the Time references Yesterday, Today and Tomorrow
To show a system Field in a message, insert it with Use field. Typing its name, such as @created or @browser, leaves the message empty where the value should be.

How to greet returning visitors differently

To greet returning visitors differently, check whether Created is LESS THAN Today: a visitor whose ID was created on an earlier day has been here before.

In this example, a restaurant booking agent, Trattoria Sole, welcomes visitors right after they tap Book a table. Its Conditions block checks whether Created is LESS THAN Today:

● Green output (true), a returning visitor: "Welcome back! Nice to see you again. 👋"

● Red output (false), a first visit today: "Welcome to Trattoria Sole! First time here? You're in for a treat."

Conditions panel checking whether Created is less than Today, with the welcome back and first time messages

Don't be surprised by the panel after you save: it shows Created as ¿·&created·? with a CREATE button, and Today as ¿·&date[today]·?. That's how the Conditions panel displays system Fields. The block works as set, so there's nothing to create.

How to offer a person only when your team is online

To offer a person only when your team is online, pick Team members online in the IF box of a Conditions block. It needs no operator or value: the condition is true when at least one person on your team is online.

In this example, the Trattoria Sole agent checks Team members online before asking for a date:

● Green output (true), someone is online: "Someone from our team is online right now, in case you'd rather talk to a person."

● Red output (false), everyone is offline: "Our team is offline right now, but I can take your booking."

Conditions panel set to Team members online, with the online and offline messages

In the panel, Team members online shows as "online", while the block on the canvas reads "IF Team members online". To hand the chat to whoever is online, follow the green output with a Human Takeover block.

How to check whether a date is today

To check whether a date is today, compare the date Field with Today using EQUAL TO.

In this example, the Trattoria Sole agent asks "Which day would you like to book? (dd/mm/yyyy)" with an Ask for a date block, saves the answer in @booking_date and checks whether @booking_date is EQUAL TO Today:

● Green output (true), a booking for today: "For tonight, please call us on +34 600 000 000 so we can check for a free table."

● Red output (false), any other day: the agent goes on to check the terrace.

Conditions panel checking whether booking_date is equal to Today, next to the Ask for a date block

The answer and Today don't need to look alike. A visitor who types 22/10/2026 gets the green output, even though Today holds 2026-10-22: the Conditions block compares the dates, not the way they're written.

How to compare a date with a date you choose

To compare a date with a date you choose, save your date in a Date Field with a Set a Field block, then compare the two Fields in a Conditions block.

In this example, the Trattoria Sole terrace closes for the winter on 1 November 2026, and the agent tells visitors whether they can still sit outside on the day they picked:

1️⃣ In a Set a Field block, create the Field @terrace_closes with the Date format and type 2026/11/01 in Type the value.

Set a field panel saving 2026/11/01 in the Date Field terrace_closes

2️⃣ In the Conditions block after it, check whether @booking_date is LESS THAN @terrace_closes. Pick @terrace_closes with Use field.

Conditions panel checking whether booking_date is less than terrace_closes, with the terrace open and closed messages

The two outputs of the Trattoria Sole terrace check:

● Green output (true), a date before 1 November: "🌿 Good news: our terrace is still open on 25/10/2026", with the date from @booking_date.

● Red output (false), 1 November or later: "🔥 Our terrace is closed for the winter by then, so we'll seat you inside by the fire."

LESS THAN and GREATER THAN are strict, so a booking for 1 November itself takes the red output. If the terrace were still open that day, the closing date to save would be 2026/11/02.

Which date formats work with the Conditions block?

Every Format to save the date in the Ask for a date block works with the Conditions block, as long as the date is saved in a Date Field. The Conditions block compares Date Fields as dates, not as text: 25/10/2026 is LESS THAN 2026/11/01, and 12/05/2026 saved as MM/DD/YYYY counts as 5 December.

An Ask for a date block always saves to a Date Field. In a Set a Field block, pick Date as the format when you create the Field.

Keep both dates in Date Fields. A Conditions block that compares a Date Field with a Text Field holding a date stops the conversation: the visitor gets no reply after it.

A date from a Webhook block can go straight into a Date Field when the service sends it as YYYY-MM-DD, such as 2026-11-01: in Save Responses as Fields, create the Field with the DATE format. Other formats, such as 2026/11/01 or 01/11/2026, can make the Webhook block take its Failed output and save none of its Fields, so ask the service for YYYY-MM-DD.

How to reply differently on a specific page

To reply differently on a specific page, check whether Url CONTAINS a word from that page's address. It's an easy way to give one agent a different twist on each page of your website.

In this example, the Trattoria Sole agent is embedded on the restaurant's website, including its private events page, and checks whether Url CONTAINS private-events:

● Green output (true), the private events page: "Planning a group dinner? Our private room seats up to 20 guests. Just mention it in your booking."

● Red output (false), any other page: the agent goes straight to "Anything else I can help with?"

Conditions panel checking whether Url contains private-events, with the private room message
Trattoria Sole chat on the private events page with the terrace open and private room messages

Country, Browser, Device and OS work the same way: use EQUAL TO or CONTAINS with the value as Landbot detects it. The values look like these:

● OS: for example iOS, Android or Mac OS X.

● Browser: for example Mobile Safari, Chrome Mobile or Chrome.

● Device: for example iPhone or Mac. Some browsers, such as Chrome on Android, don't share the phone model, so Device can hold a short code instead.

● Country: for example Spain.

To tell phones from computers, check OS rather than Device.

These values come from what the visitor's browser shares about itself, described in the navigator.userAgent reference. To see what a device sends, add the Field to a message with Use field and open the chat on that device.

For WhatsApp

The Conditions block works the same way on WhatsApp, with the system Fields WhatsApp fills in. Browser, Device and OS aren't collected on WhatsApp, so don't build conditions on them there. Name and Phone, on the other hand, come straight from the contact's WhatsApp profile.

For Facebook Messenger

The Conditions block works the same way on Facebook Messenger, with the system Fields Messenger fills in. Name, Phone, Browser, Device and OS aren't collected by default, so ask for the ones you need with question blocks before a Conditions block checks them.

Was this article helpful?

Conditions block

Close Chat block

Contact