https://discord.gg/botpress logo
Passing Web Variables
# 🤝help
w
I am a little confused with this piece. Looking at the doc's (https://botpress.com/docs/webchat/interact/send-user-data#send-user-data) I am seeing this, which is great. I want to send first name and variable of which KB to use. *window.botpress.on('webchat:initialized', () => { console.log('Webchat has been initialized. Loading user...'); window.botpress.updateUser({ data: { firstName: newFirstName, lastName: newLastName, email: newEmail, }, }) });* In the doc it show suse the "Get User Data" card and then {{event.userid}} ... my question is does event.FirstName get the first name or do I have to do this another way? Having trouble finding the correct route here. Thanks in advance.
l
Taking a look!
Add a Get User Data card in Studio. Set User ID to {{event.userId}}. Store the result in a variable (e.g., workflow.userData). Then you can reference the first name later with {{user.firstName}} or {{event.user.firstName}}.
w
Awesome. Thanks Ross. I will give this a go tomorrow!
4 Views