Table of Contents

Airtable usecase: Create an event registration bot with limited availability

Pau Sanchez Updated by Pau Sanchez

In this article we will explain a case, where a user want to create a bot to let the users register in different inside events, that have limited seats.

Set up in Airtable

  1. We will start in Airtable creating a Table that we will call "registration", here is where we will keep the details:

  1. Now we can add the different data we want to require to the user

In this case, we set up the first field as id (type autonumber), then name and email

  1. Then we will use the default Status, as is a Single Select, to set the events that the users can register to

  1. We need a way to keep count, and the best way would be to create a new table, that we will call counter:

  1. Now is when we need to link both tables. To do so, we will return to the "registration" table

  1. We add now a new column/field, that we will use as a reference to link both tables, so we will call it "ref" and will be type "Link to another record"

  1. And we select "counter"

  1. And "Allow linking to multiple records", then press "Create field", after press SKIP

  1. Back to the "counter" table and we will delete the fields we are not using (Notes, Attachments, Status)

  1. We will delete also the second and third records, we only want 1 record (row)

  1. Great, now we need to set up the fields were we are going to "count" the people registered per event. To do so press to create a new field and select type count, we will call it "count_event_1"

  1. Switch to "Only include linked records from the registration table that meet certain conditions" so we will count only people that has selected the event 1

  1. And we will create a field/column for each event with the condition required as we just did:

  1. And finally to the first cell under name, we will type "ref"

  1. Now if we add sume testing data in the "registration" table:

If we check our "counter" table we will see that the different events are being counted correctly

Great, now we can delete the users in the "registration" table before we add data from Landbot

Set up in Landbot

Now the goal in Landbot is to set up a flow that will:

A. Ask the user for the basic data

B. Check in Airtable the events available, but checking the counters

C. Based on numbers with conditions we will create a list (array) of events that the user can select

D. Once the user selects an option, upload the data to Airtable

  1. First we will start asking for the name and email

  1. We need to check the availability to do that we will add an Airtable block

  1. And set up the Airtable block to capture this record (row)

To so, it will be like this:

And we will filter with the Advanced way:

SEARCH("ref",{Name})

And the last step! Store the data in the numeric variables:

  1. Now we need to have an array variable where we will add the list of events that will be available for the user to choose:

  1. To check if the event is available for the user to choose, we need to make sure that the counter is below the limit, for this example we will offer up to 20 seats:

  1. And we will create the same conditions but for the other events:

  1. We will connect them, for the cases where it has reach our limit (20):

  1. Now we need to add to the list of events available in case the number is below 20. To do that we will use Formula block, to Push() to the variable we created earlier:

As you see here we use for the same name "Event 1" as we do in the Airtable, that is important that is exact match!

  1. Now we will repeat the process for the other events:

  1. And we will connect it:

  1. Right before to show the events available we need to do 2 things. The first one would be to "clean" the array:

  1. And also, we need to check if there are any events, based on the "length" of the array. If is 0 means, that all the events are full

  1. And finally, we display the events to the user, using Dynamic Data block:

  1. Where we will use this set up, and store the event selected in the variable @event. Bear in mind that won't work for multiplechoice!!! Only one event at a time

  1. Now that we have all the data, we can upload it to Airtable:

  1. In the Airtable block we will do the following set up:

And this :

It is very important that the "ref" field has the "ref" value, not a variable

And that's it! Now you can customise it to your needs!

How did we do?

How to disable a bot

How to calculate the number of days between two selected dates

Contact