fast-yak-55876
09/18/2023, 4:12 PMjs
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