Table of Contents

Fields in Landbot - Getting Started

Jonathan Goodfellow Updated by Jonathan Goodfellow

Variables are now Fields, String fields are now text fields

Prefer watching than reading? No problem, we've got you covered πŸ‘‡

What is a Field? πŸ’¬

Every time you ask a question in the bot and want to store that answer somewhere, you save this answer (value) in a field.

Think of a field as a "box" that you can give a name and store "things" inside.

In this case, those "things" can be values you give to that field.

What are the field formats? πŸ“

Some blocks have a format by default, that you can't change. Nevertheless, it's possible to make operations to change a field type, but it is easier if you choose the block wisely beforehand πŸ˜‰

According to the use, you will give to the field you must choose a specific format for each one, like Date, Number, String (Text), and Array.

Text (string):Β This is the most flexible type of field. It is usually used to save Text inside it, but you can also add numbers, dates, signs, emojis, hyperlinks, etc.

Number:Β here you can ONLY save numbers, not symbols or letters.

Β Date: save dates inside these field.

Array:Β An array is a data structure that contains a group of elements. Typically these elements are all of the same data type, like a String or Number.Β An array fieldΒ is very handy if you are a developer or if you want to try out more of our technical features and workarounds.

Boolean:Β YouΒ can't create or save fields in this typeΒ due this is a system field that is used only in a Condition block to check if the agents are online.

How do the fields work? 🧐

As the name says itself, the value you save inside a field may change according to the answer given by the user, or the choices made throughout the bot flow.

To create a field:

  1. Select a block and add it to the builder.
  2. Scroll down to Save answers in the field.
  3. Name the field whatever you want, but note that it must always have @ (symbol) before the name.
  4. Choose the format of the field [number, (text string) , date, array] and save it.
Tip: The Name you assign your field should be accurately descriptive and understandable to another Teammate in your account πŸ˜‰
Example 1

If I want to ask for the user's name (value) and save it in the field @name :

You can create or customize a field in a block, in the Save answers in the field > Custom field subsection of each block.

When 2 different users go through the bot flow, the field will have the same name ( @name ), but the value will be different for each user:

As you can see in this example, the field where we store the name of the user is the same, saved under the name @name but the value stored in it will change according to what each user answers. So:

@name = Maria

@name = Paul

Example 2

In the next Button block, the answer will be saved in the field @testing:

Then we will use the field @testing in a Message block, to inform the User which option has been chosen before.

To add the field to the block, we have two options:

  1. Write @testing in the Send a Message block:
  1. Click on the fields option of the Send a message block (field list), and choose the field:
  • Write testing and choose the correct custom field:
  • Click on the field testing, then the result will look like this:
  • Now, the final view in the chatbot will be, according to the choice of the user in the Buttons block:

May I reuse fields in distinct blocks? πŸ€“

Sure thing! 🀩

Example 1

Let's continue with our previous case scenario but now we'll ask for the age as well:

  1. Add the block Question: number in the builder and save the answer in the field @age
  1. Now add the field @age in the Send a message block with both fields (@name and @testing):
  1. This is how it's seen in the builder:
  1. Last but not least, the chatbot final view:
Tip: you can combine more than two fields. Just be aware that the Send a message block can't be saved in a fields.
Example 2

πŸ‘€ If you want to use two similar blocks, Buttons block, in different parts of the bot, you will have to change the name of the field set by default so that the previous field is not overwritten

  1. We added the first Buttons block, then we created and saved in the field named @food_options
  2. We added the second Buttons block, then we created and saved in the field named @drinks

Landbot's System field types:

Landbot has it's own System fields that you can use in your bot flow and consult in the Metrics and Chats section.

  1. Fields for Lead Data
    Although these are system fields, they can be edited:

Example:

In the next case scenario, we added the Question: email block, as you can see this has the @email field by default, but we change it to @email_support

  1. Field Usage details

You will be able to identify which ones are the System fields Usage details because they come with a lock πŸ”’next to it, so you can't edit them

Note: You can find more information about it by clicking here Landbot System Fields πŸ”—

May I use a custom field and a system field in the same block? πŸ–‡

Of course, you can! πŸ₯³

Let's imagine that you want to ask the name of a user, and save it in a field to use it later with the previous @testing field:

  1. Add the block Question: Name in the builder, the answer will be saved by default in the field @name
  1. Add the field @name in the Buttons block (to refer to your customer by personal name):

  1. Now, add the field @name and the field @testing in the Send a message block:
Here we mixed the ways to typing the fields (choosing through the fields button or writing with the @ symbol before the name)
  1. You will see it like this in the builder bot:
  1. Then, the final view in the chatbot will be:

Are there other uses with fields? πŸ™ŒπŸ»

Yes, they are! You can see some of them here:

Set a Field

This is a powerful block that allows you to create, establish a format, and set (define) value to a field, as you can see in this article.

Display images

With a field containing a URL source, as you can see in this article.

Make a counter for fields

You can find further information about it in this article or this demo 🀩

Additional information ⚠️

  • It's not possible to leave a field without values.
  • It is not possible to delete a field once you've created it. You can unset a field instead.
  • However, it is possible to manually delete the fields for a specific user in the Chats section. Only the fields you’ve created (Custom fields) will be deleted, not the Landbot System Fields. Click here for more information.
  • It is not possible to change the type of field eg. string to number once it is set.
  • If a field has a value set and you want to overwrite it, you can use a set field block.
  • If you find a blank field list it's because the user didn't answer the question that had that field.
  • Arrays have a limit of 1MB anything more will cause errors in the Dynamic Data block.

How did we do?

Builder's keyboard shortcuts and mechanics! πŸ—

Contact