userData field on webchat init config
# 🤝help
q
I need to send custom user data to the bot before a user engages in the chat. I saw this property "userData" on the botpress github repo https://github.com/botpress/botpress/blob/master/integrations/webchat/webchat.html and was wondering how I can access that data passed once the botpressWebChat initialises. I would appreciate any way I could send data to the bot and store it in the workflow object 🙏
a
@quaint-accountant-43414 do you have this card in your tray? I'm not sure if it has made it to the public release or not, but this card is how you do it
q
@acceptable-kangaroo-64719 I haven't seen it, but I'll take a look
I do not see it when I drop the execute code card or among the card options ? is it in the paid plan by any chance ?
@acceptable-kangaroo-64719 if this isn't released yet, is there another way I can send custom user data once the webchat has initialised ?
a
I guess it isn't public yet. You can try using a "before incoming message" hook to catch the data
q
@acceptable-kangaroo-64719 , I have been on it for some time now but I don't know exactly where to extract the values from, would appreciate a better understanding of how to do this
the event obj doesn't seem to have the userData property so .....
c
I see this card, but can't seem to figure out how to access the data that's passed with userData. I created a variable to put the object in, but when I try to access it, it shows undefined.
a
We're releasing a video on triggers today, and there's a new tutorial all about passing data from your website to the bot, check it out here https://discord.com/channels/1108396290624213082/1132038253109837994/threads/1136967981755269270
136 Views