Table of Contents

Create custom Landbot variables & formats

Pau Sanchez Updated by Pau Sanchez

How to create a variable

Variables can be created in many places, but the steps are the same:

  1. Click in VARIABLES:

  1. Start writing the name of your desired variable name, once you see the CREATE button, press it:

Naming rules for Landbot Variables:
- It has to be more than 3 characters long
- Cannot be space
- Cannot use any special character

  1. Select the desired format and press CREATE:

Formats: String, Number, Date, Array and Boolean

  1. String: Variables that contain any type of text
  2. Number: Variables that contain numbers
  3. Date: Variables that contain dates
  4. Arrays: Variables that only can store value coming from a Webhook. It can be an Array of Strings or an Array of Objects. Cannot be created with the Set Variable block and is meant to be displayed with the Dynamic Data block
  5. Boolean: Restricted currently for Agents availability

How to delete variables created (custom variable)

Maybe for some reason we don't need a variable anymore or it has the wrong name. Then the only thing you need to do is hover over the variable in the selector and click on the "trash" icon

This variable will remain in the locations where are currently placed. Please do not use this, to change the format of the variable, you will need to use a new one

FAQ & Troubleshooting:

How can I give value to a Landbot variable that I've just created?

You can give it a value with the Set A Variable block

How can I check in a condition if a variable has any value?

You can use the IS SET condition, if FALSE, is because the variable has no value

Can I change the type of format once is created, for example from string to number?

You cannot change the format of a string once is created, but what you can do is with a Set Variable block, create a new variable with the desired format and use the value from the other variable

How did we do?

Send variables from your page (the container site) to your embedded Landbot