https://discord.gg/botpress logo
How to get the tags from the conversation in an In...
# 🤝help
l
I'm trying to write an Integration that has a bunch of custom Actions. I'd like to be able to read the tags from the conversation and use these in the request to my service. I've tried specifying the conversation as an input parameter, but this doesn't show in the studio, so I can't simply specify {{conversation}} as the input. The channels handler passes in the conversation as a property so makes this easy. But the actions handler doesn't. Anybody got any ideas. Thanks.
w
i'm spitballing here but maybe the event has the tags
try sending a test event to botpress on a conversation that has tags then inspecting it in your dashboard
l
Hey @late-spring-72999 😄 going to do some digging and get back when I can get some insight!
l
@shen and @Ross thanks guys. I think you're right, the event does have the tags. {{ event.tags.conversation }} so I'm trying to use that now. It would be great if I didn't have to specify this on the action, and it was available in the action handler so I can pick it up in the code (as it would not be me building the bot). my other confusion was I had assumed event related to an incoming Event, whereas its more like the javascript object that is passed into an event listener.
w
i don't quite understand what you mean by pick it up in the code. can't you just do ${event.tags.conversation}?
w
you can access it on event.conversationId though
or is that another conversation id you want to pass
l
yes, its the external conversation id which im storing in a tag. what im trying to do is build the integration so that the people using it don't need to know the internals of my integration to use it when building their bot. I have almost got it working using the input https://cdn.discordapp.com/attachments/1430214482579165326/1430240532541472808/image.png?ex=68f90ecb&is=68f7bd4b&hm=010aab59abe118d66cb13eb27a281f57cb41bab3eedc1a5e3e7d9a9158dcb017&
2 Views