Data gathered inside of bots is often sent to an external database. An easy way of doing this is by ingrating with Airtable. Airtable is a tool that allows you to create a spreadsheet that you can talk to with an API.
In this tutorial we will set up an integration with Airtable. Because of all the code it looks quite technical, but in fact it's pretty easy.
If you're new to using variables in Chatlayer.ai, follow this tutorial first.
Start by building a short flow that you use to gather some data about your user, for example:
This flow adds the variables "customerType" and "firstName" to the session of the user.
Set up an Airtable that has a column for each variable you want to save. Rows will be added for each customer.
In this tutorial, we will be using this Airtable. Feel free to reuse it!
At the point in the flow where you want to send the data to Airtable, add an Action containing a Code plugin.
Want to learn more about the possibilities of the Code plug-in? You can find it here.
In our example, we want to send the customer's type and first name. Furthermore, we want to jump to another bot dialog as soon as the data has been sent. Start by adding these parameters at the top of your code editor.
Then add the code below to the plugin and save your Action dialog.