Easier Zapier/Webhook Integration (send data to an...
# 🤝help
n
Hi Botpress team! I wanted to give this post an appealing title because i've noticed a few people trying to find ways to make an easier integration with zapier to send data back and forth rather than just using webhooks - but i do also need help finalizing the set up with this so i think it will be very helpful to many people. To Botpress users - instead of utilizing webhooks to go back and forth, i suggest using the zapier integration when you're adding integrations to your bot, its an easy set up and it looks like it will work easier. just click (how can i connect my chatbot?) and you'll be done in 2 minutes. To the botpress team - I've set up the zapier trigger (though i haven't tested it yet) so i should be able to send data to the bot with ease. However, i'm having trouble finding where i can send data to zapier described in the screenshot from your documentation. I can't see anything in the cards section. Am i not looking in the proper place? Thanks in advance!

https://cdn.discordapp.com/attachments/1141443975778152468/1141443976000458864/image.png

w
hi @numerous-raincoat-32414 . this zapier integration gives its own Webhook URL. so do we need to disable the original Webhook integration?
n
if you're sending/receiving webhooks from/to a source other than zapier then i would say keep it - however if all of your webhooks are being utilized solely for the purpose of connecting to zapier i think you're probably good to disable the original webhook integration, though i it shouldnt be an issue to have both up. just be mindful of which webhook url you're using 🙂 This is assuming that we don't need to send the information to zapier utilizing post webhooks from the execute code cards - i'm not sure about this. Waiting on a member of the Botpress team to confirm how we can utilize the zapier integration to send information from botpress to Zapier!
w
@numerous-raincoat-32414 Thank you for detailed response. i will run some test and update here
n
My pleasure! I'm excited to get this problem resolved because like i said i've noticed multiple other posts now of people trying to figure out an easy solution and I think this might be it 🙂 best of luck!
w
well this is hilarious if this integration was been around for long and nobody knew about it😂
n
Right?? could you imagine? 😂
f
@numerous-raincoat-32414 Thanks for sharing this info with the community! There have been a few setbacks on making the actions and triggers generally available, which are needed for our Zapier integration. Could you send me a DM mentioning the email address of your Botpress Cloud account so I can take care of manually enabling these for you so you can see the Zapier action and trigger in the Studio?
n
certainly! Going to DM you right now
I'm sure many of us (myself included) would love to hear it! what've ya got?
thanks to @famous-zoo-73118 for getting that linked up! i'm sending data back and forth but now i wanted to post this for anyone else who may now be encountering this issue: i'm having trouble finding a way to access the data within the botpress event payload. this is how it comes in: { data: '{"message":"Hello Botpress!}', correlationId: 'cr1' } in an execute code card i can console.log the whole data, however i am having trouble accessing the actual data. Please advise! 🙏
Update! the issue was me lol
I discovered that i need to access data in the event.payload, JSON.parse it and then store that as a variable and access the specific things via that (code below) const info = JSON.parse(event.payload.data) console.log(info.message) by putting that in an execute card i was able to console.log the message part of the information i sent back to botpress!
f
@numerous-raincoat-32414 Because the payload data is being sent as JSON from Zapier, you'd need to use something like
workflow.zapierData = JSON.parse(event.payload.data)
in an Execute Code card and then you could access the message through
workflow.zapierData.message
. This is assuming you're going to use a Code Step in Zapier to craft the payload data as a JSON string to send to Botpress.
Alternatively, if you only need a single piece of data you could simply pass the raw field value in Zapier to Botpress:

https://cdn.discordapp.com/attachments/1141443975778152468/1141781284729917651/image.png

... and then
event.payload.data
would contain that text value you sent.
So in summary, if you just need a single piece of text to send from Zapier to BP, just put it as a plain event data and access it directly in your bot, otherwise if you need multiple fields you need to craft an object in a Code Step in Zapier, convert it to a string using
JSON.stringify()
in the code step, send that JSON string as the event data from Zapier, and then in your bot use
JSON.parse(event.payload.data)
to convert the JSON string back to the object that was originally crafted by the code step in Zapier.
n
Thank you so much for all your help @famous-zoo-73118 that's great to know especially for the single piece of data part as well. For anyone in the future who will read through this thread - MAKE SURE that when you enter the info into the event data section in zapier its properly structured as JSON, the reason i couldn't access it is because i didnt enclose my message value in quotes lol
m
@famous-zoo-73118is the botpress integration with zapier the same as using webhooks?
f
It's pretty similar, but the BP Zapier integration is a bit easier to use as you don't need to craft HTTP requests on either side
m
so if i want to make real data appear in a google sheet using the zapier integration on botpress this is possible? if so, how?
f
Yes, it's possible. We don't have a specific tutorial to show this step by step but it's likely we'll make one once the Zapier integration is out of beta. You could also request this in the #1111026806254993459 channel so other people can upvote it. For the time being, the only available reference is our documentation page for Zapier (https://docs.botpress.cloud/docs/cloud/channels/zapier/) and the information I shared in the other Discord thread I linked to above.
m
when will the tutorial be out?
f
Not sure how soon, but you can request one in the feature requests channel so the team can prioritize it based in how much it's upvoted by other users
f
Send Event doesn't work for me. If I test it in the console, I can access the Zapier data in my bot, but when I try in a live webchat, nothing happens. Is this an issue with the integration or could I be doing something wrong?
f
Could you record a video of the workflow? (you can try using Zoom.com) Happy to look at it to make sure nothing is missing.
For future reference, our Zapier documentation page has been updated with more detailed instructions and screenshots on how to integrate it with Botpress for sending data to/from Zapier: https://docs.botpress.cloud/docs/cloud/channels/zapier/
i
I have followed the steps and enabled Zapier but I don't have a 'Send to Zapier' card in the execute section.
f
Please send me a DM with the email address of your BP Cloud account, events/triggers in general for all integrations are still not generally available for all users, so I'll make sure your account has them activated.
i
Awesome thanks, sent you a friend request
bump
f
A DM (direct message), not a friend request 😉
i
It seems your DMs is closed to friends only
f
Hmm, strange, they should be all open AFAIK. If you can't send a DM please send your account's email address to sherlock@botpress.com and let me know so I can check the message.
i
👍 sent
f
All set! You should have access now.
31 Views