Pass user data to webchat and use it in the workfl...
# 🤝help
Hello I am trying to pass user data to the webchat like for example, user id, user name, etc. And then be able to use that data in the workflow to do different things for example calling a REST Api to show the user specific information in an external system. Please see attached the pic with the parameters I am using to initialize webchat. Now in the workflow side I am trying to use the Get User Data card to get the user data. But is not working for me, if someone could point to the right direction here, Thank you!

Hi, @brash-fireman-56077. Theoretically you just need to add the card "Get User Data" in that card you must define the userID with {{event.userId}} and choose a variable (object) that will contain the data placed in the UserData. After that, it is necessary to create a Code card to pass the data of this object to variables, in your case it would be: = In this line above I'm accessing the name inside the object, remember to replace this objectName with the name of the variable you put in the "Get User Data" card. Sorry my english is very bad ;-;

🤔 But I'm having a problem with this and I would like to take the opportunity to clarify this doubt as well. In my case I'm trying to pass the URL of the page in this parameter because each user will enter a page with a different token. I'm trying to use it this way: userData:{url: window.location.href} It works! but only with a user, if I open it in an incognito tab it leaves the object as "{}" in this example I am returning the {{event.userId}} and the @workflow.ObjectUser:

Thanks @microscopic-lizard-92513 I will try the way you did it and let you know the results.
Ok I tried that, this are the results

I am getting empty every time.
I just logged what is in the workflow after Get User Card is executed.
It didn't work then ;-; sorry. I think we are really going to need some help from someone at botpress team.
Thanks anyway.