How to create a Dynamic Knowledge Base (Receiving ...
# 📖tutorials
g
The second option we have to create a Dynamic Knowledge Base is to use Make.com. It doesn't have a direct integration with Botpress, but we can still utilize the more budget-friendly version of Zapier to get this done and here's exactly how: Step 1: Make.com Setup 1. Start a new automation with Sheets as a Trigger and connect it with HTTP Request (As shown in the first pic) 2. Paste the Webhooks URL from Botpress (you will have to install the Webhooks integration in your bot to get the URL) , choose "POST" as the method and pick JSON as the Content Type. 3. The data from the sheet should be transferred in the JSON format (You put the data you want to transfer in Request content), here's the format example so you can copy-paste it: { "jobTitle": "1. Job Title: Programmer 2.0", You can just pick your variable from the list, so it's quite easy. Step 2: Botpress Setup 1. Create a Trigger Node with the Webhook Event card (You get it available after you install the Webhook integration in your bot) 2. Connect the Trigger Node to a Standard Node containing an Insert Record card, IMPORTANT the data received by BP should also be in the JSON format, so make sure you put it properly in the fields of the Insert Record card, here's a copy-paste example: {{JSON.parse(event.payload.data).INSERT YOUR VARIABLE HERE}} (Shown in pic) 3. Publish Bot to receive data
m
OMG @great-doctor-10753 thanks for making that happen! I've been researching this, trying to find an answer for the last 2 weeks haha. I went right ahead to implement your solution but encounter an issue, which is, the table updates the columns not with the variable values but the json request itself. In my case, the trigger is not a Google doc but Airtable. But I would assume it works just the same. Could you please have a look at my screenshots and see if you can identify where I go wrong?
g
Hey @magnificent-belgium-43933 , I feel you, I also spent enourmous amount of time trying to fiugre it out 😄
So in your case in the HTTP request, in the request content section, you haven't put it in JSON format, should look like this { "event": "1.Event", "properties": "1.Properties"} , that should do it
k
Oh man. Maybe my account is have a tough time with the triggers.@great-doctor-10753 I have tried your strategy and I've got nothing wrong there. Oh man, I'm really struggling getting them to work.
Here is my Botpress workflow. Oh man. They are not working for me.
m
Hi @great-doctor-10753 , I noticed that the fields under "Insert Record" don't really evaluate JSON.parse() functions, even though other JS keywords like
VAR
are allowed. As an alternative solution, we can access the JSON payload directly like so:
event.payload.body.<VARIABLE HERE>
In @magnificent-belgium-43933 case, it would be: -
event.payload.body.event
-
event.payload.body.properties
k
@magnificent-belgium-43933 Did this work for you?
g
Hey @kind-cpu-15492 , apologies for the delay
You haven't given a command to Insert Record in your workflow
In the Standard 3 Node, below console.log, it should be an Insert Record card, not a text card 🙂
k
@great-doctor-10753 Thanks for getting back to me. It doesn't really matter that much for me since the trigger doesn't work.
To show you what I mean. Here is my HTTP POST Request inside Make.com
But to answer you I did have a "INSERT RECORD" card. I've also fixed this, and instead I've added a trigger.
b
hey @great-doctor-10753 can you help me out here as i didnt understand what to do in the second step👇 2. Paste the Webhooks URL from Botpress (you will have to install the Webhooks integration in your bot to get the URL) , choose "POST" as the method and pick JSON as the Content Type.
How to add webhook event?
g
Hey, are you stuck in BP or Make.com?
b
This is what i have done but im not seeing any update in the dataTable1 Help @great-doctor-10753
What i want to do is to create a table that has all the data of products so that i can take some user inputs (his requirements like type of clothes and ocassion for example) and then by searching in this table the chatbot should suggest the best suitable products
so everytime i add or subtract any products from the google sheet, the dataTable should change
is it possible to update the table using the concept you have proposed above?
Hey @great-doctor-10753 🙌
53 Views