In this tutorial, I'll show you how to inform your chatbot user about the availability of your stock in real-time with Integromat / Make and Airtable. Based on the result, you can create two different conversational paths.
Let's say that you distribute NFT links to your audience that follows your events.
You need to be sure that you give unique links to each user.
Once there are no more links to distribute, you need to inform the user that there are no more available links anymore.
Let the chatbot do the work! 🤖
Here are the steps to follow:
Create your Joonbot
1. Create your chatbot, add questions to check if the user attended the meeting (if you want) and then add a webhook block. You'll edit the webhook block later.
The webhook block will send back the variable "link", whose value will be the available NFT URL or the sentence "nothing".
2. Add a "set variable" block to create a variable whose value is the "link" variable that you will receive from Integromat.
You need to create this variable to be able to reuse the data sent by your webhook.
3. Finally, add a logic jump block. With this block, you can create two paths depending on the value of the "link" variable.
If the value is "nothing", you follow the "true" path, and then you reply to the chatbot user that there are no more NFT links.
If there is one available link, the value is the link, so you follow the "false" path, and so you give an NFT link to the chatbot user.
Create your Airtable
Create a column that you name "Links" with all your links and add a column called "Shared", which is a single select "yes" or "no".
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 there is an available link, meaning a recording with "no" in the "Shared" column of your Airtable.
For that, you need to add this formula:
({Shared}="no")
⚠️ You only want one link available, so make sure to add the limit to the search to one.
8. Add a router and click on it. It will create two paths.
You need one path in case there is one available link, meaning that the output of the Airtable block you previously created sends a "links" record whose value is a link (so not empty).
For that, click on the nut wrench of one of the links.
Now add the condition the variable "Links" exists.
For the second path, you don't need to do anything. The flow will continue here as the "Links" 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 {"links": {Links}} if there is one available link.
Otherwise, you want to receive the webhook answer {"Links": "nothing"}.
{"Links": "nothing"}
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".
Link available in Airtable for the chatbot user
No links available in Airtable for the chatbot user
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.