Hi, scuse me. I am Using the webchat intégration. ...
# 💻developers
f
Hi, scuse me. I am Using the webchat intégration. I override userId in webchat, and it works, but if i want to pass custom user data, surname per exemple, i can’t make it work and access the custom data inside the bot workflow.
Copy code
js
window.botpressWebChat.init({
  botId: '<botID>',
  hostUrl: 'https://cdn.botpress.cloud/webchat/v1',
  messagingUrl: 'https://messaging.botpress.cloud',
  clientId: '<clientID>',
  userId: ‘my custom Id’, // thats work
  userData: {
     ´custom field’: ‘custom value’
  } // thats not working i cannot access to this field 
})
`
From the botpress studio, i use following script at the beginning of the workflow : workflow.custom_field = workflow.userData.custom_field However if i console.log(workflow.userData) it works, but i cannot access the workflow.userData.custom_field attribute. I would be thankfully for any help