In this tutorial, I'll show you how to search for an item in your Airtable and give back the data you want to your chatbot using Integromat / Make. You can create different conversational paths depending on the outcome of the search.
Let's say that you distribute NFTs to your audience that follows your events.
You need to be sure that people that claim NFTs are not farmers.
You have an Airtable database with all the Ethereum addresses that you have blacklisted.
Let's the chatbot do the cop! 👮
Here are the steps to follow:
Create your Joonbot
1. Create your chatbot and asks for the Ethereum address. Save the answer under the variable name "eth_address".
2. Add a webhook block after. You'll edit the webhook block later.
This block will send back the "safe" variable which will be either "yes" or "no".
3. Add a "set variable" block to create a variable (reusable in Joonbot) whose value is the "safe" variable that you will receive from Integromat.
You need to create this variable to be able to reuse the data sent by your webhook.
4. Finally, add a logic jump block. With this block, you can create two paths depending on the value of the "safe" variable.
If the value is "yes", you follow the "true" path, and so you give an NFT link to the chatbot user.
If the value is "no", then you reply that to the chatbot user that he will not receive an NFT link.
Create your Airtable
Create a column that you name "Ethereum addresses" and add all the suspicious Ethereum addresses that you have collected in this column.
Create your Integromat / Make scenario
1. Create a new scenario and add the trigger custom webhook.
2. Create a webhook by clicking on the "Add" button and name it the way you want.
3. Copy the Webhook URL
4. Go into your Joonbot, click on your webhook block and click on the "edit my webhooks" button.
5. Click on the "Create webhook" button, name your webhook, choose POST as the webhook method, paste the Webhook URL in the field below and save.
6. Now, click on the Joonbot logo on the upper left and go back to your chatbot.
Click on your Webhook block and choose the webhook you just created.
Choose "No" for the Asynchronous option.
7. Now, go back to Integromat / Make and add the new action to your scenario: the Airtable search Records.
Connect your Airtable account, and pick your database and table.
Here, you want to know if the Ethereum address given by the chatbot user is in your Airtable.
For that, you need to add this formula:
({Ethereum addresses}='eth_address')
{Ethereum addresses} is the title of your column in your Airtable and eth_address in the name of the variable where you store the Ethereum address answers of your chatbot users.
8. Add a router and click on it. It will create two paths.
You need one path in case the Ethereum address is in the Airtable and another one in case not.
For that, click on the nut wrench of one of the links.
Now add the condition "Ethereum addresses" exists.
"Ethereum addresses" is one of the variables given by the previous Airtable action.
This variable exists if the Airtable block finds the Ethereum address given by the user in the Airtable.
For the second path, you don't need to do anything. The flow will continue here as the "Ethereum addresses" variable doesn't exist.
9. Add a new action to each path into your Integromat / Make scenario: the Webhook response.
⚠️ Joonbot webhook block expects a JSON, so you need to send back a JSON format.
You want your webhook to send {"safe": "yes"} if the Ethereum address of your user is not in your Airtable. Otherwise, you want to receive the webhook answer {"safe": "no"}.
{"safe": "yes"}
10. Time to test now!
Within Integromat / Make, you can click on "run once" and test.
⚠️ The test runs once so if you want to test twice, you need to click on the button again.
If everything is ok, activate your integration. Ensure you have the right option selected: "Immediately as data arrives".
Ethereum address NOT in the Airtable
Ethereum address IN the Airtable
If something doesn't work
If you make some changes in your Joonbot, don't forget to redetermine your data structure in your custom webhook block.
Re-run to see if everything is ok now.
Also, maybe there is something wrong with your Webhook block in Joonbot. First, check that your webhook block has a webhook selected and that the URL is correct.
If your chatbot is ok and you tested your Integromat integration, and it's a success, then open a tab and paste the webhook URL. Maybe there is an issue with the JSON payload.
Comments
0 comments
Please sign in to leave a comment.