Turning on Webhooks invalidates {{event.userId}}
# 🤝help
c
See attached image. Is this normal?
f
Hey there I don't think it's invalid, I just think it's empty. You should be able to see an explanation if you hover your mouse over it
c
@fresh-fireman-491 it is red (invalid) when webhooks are on, then green when webhooks are off. I'll loom it! I am also super stumped why my script was working last night. Posting below:
window.botpressWebChat.init({ "composerPlaceholder": "Chat with me!", "botConversationDescription": "I am a test for Extendly...", "botId": "example", "hostUrl": "https://cdn.botpress.cloud/webchat/v1", "messagingUrl": "https://messaging.botpress.cloud", "clientId": "example", "webhookId": "example", "lazySocket": true, "themeName": "prism", "botName": "The GOAT.", "frontendVersion": "v1", "useSessionStorage": true, "enableConversationDeletion": true, "theme": "prism", "themeColor": "#2563eb", "userData": { "name": "Mario Aldayuz", "email": "test@test.com", "userType": "Agency", "userLevel": "Admin", "whiteLabelUrl": "test.mycrmsupport.com", "knowledgeRoot": "https://google.com", "relationshipId": "0-123-123", "agencyName": "Wahi Digital Marketing", "currentUrl": window.location.href // Set the current window's URL } });
f
Oh okay, I saw it as orange. You shouldn't share your bot id, conversation id or Webhook Id. It can be used to rack up a bill for you
Why should it not be working?
c
**it is not working now, but was working previously
@fresh-fireman-491 lol thanks, I didn't think about that, in my head it was like "anyone can inspect and grab that from my regular URL"
f
You are right, they can if you just put it in directly
Did you change something in your bot?
c
No
Just enabled webhooks (which I've now disabled)
This has been the same since last night - all I did was sleep for three hours and turn webhooks on 😅
I think I found it... for some reason turning on webhooks played havoc on my "Get User Data" and it removed the variable it was storing the info in.
Super odd bug
I swear, I'm not crazy.
Nevermind, that still didn't fix it. Hmm...
f
You can't use the "Get User Data" card with the Webhook. It's for the webchat integration.
c
Ahhhh
Well, I'm not directly
I was trying to use the webhook to have data passed back in from a 3rd party integration
So basically make an API call/fire a webhook on a specific selection happening in the Botpress flow then use the webhook integration to receive that data back
f
But is the card being used in a flow that gets triggered by the Webhook trigger or the start trigger?
c
start trigger
I removed everything webhook related
& turned off the integration
to revert back to last known working state
still not working
f
The "Get User Data" card or the variable?
c
I have: - Turned off webhook integration - Removed webhook integration - Reverted everything to last known working state
f
And which part is not working, when using it from the webchat, and not emulator
c
Removed webhook integration, now it has the object brackets, but no data
When using it from webchat
f
Can you take a look at the logs, and see what is going on there
c
Is possible to enable more advanced logging?
f
You should be able to console.log anything you want to, but I don't think that Botpress has more advanced logging
Can you send me a screenshot of your "Get User Data" card, and send me the code snippet from your configuable script, where you include the user data
c
if (workflow.userData && workflow.userData.userData) { const userData = workflow.userData.userData; // Setting the name variable if (userData.name) { user.name = userData.name; } // Setting the email variable if (userData.email) { user.email = userData.email; } // Setting the knowledgeRoot variable if (userData.knowledgeRoot) { user.knowledgeRoot = userData.knowledgeRoot; } // Setting the whiteLabelUrl variable if (userData.whiteLabelUrl) { user.whiteLabelUrl = userData.whiteLabelUrl; } // Setting the userType variable if (userData.userType) { user.userType = userData.userType; } // Setting the userLevel variable if (userData.userLevel) { user.userLevel = userData.userLevel; } // Setting the relationshipId variable if (userData.relationshipId) { user.relationshipId = userData.relationshipId; } // Setting the relationshipId variable if (userData.agencyName) { user.agencyName = userData.agencyName; } // Setting the currentUrl variable if (userData.currentUrl) { workflow.currentUrl = userData.currentUrl; } };
f
Can you send me the code snippet from your configurable script, where you include the user data
c
window.botpressWebChat.init({ "composerPlaceholder": "Chat with me!", "botConversationDescription": "I am a test for Extendly...", "botId": "example", "hostUrl": "https://cdn.botpress.cloud/webchat/v1", "messagingUrl": "https://messaging.botpress.cloud/", "clientId": "example", "webhookId": "example", "lazySocket": true, "themeName": "prism", "botName": "The GOAT.", "frontendVersion": "v1", "useSessionStorage": true, "enableConversationDeletion": true, "theme": "prism", "themeColor": "#2563eb", "userData": { "name": "Mario Aldayuz", "email": "test@test.com", "userType": "Agency", "userLevel": "Admin", "whiteLabelUrl": "test.mycrmsupport.com", "knowledgeRoot": "https://google.com/", "relationshipId": "0-123-123", "agencyName": "Wahi Digital Marketing", "currentUrl": window.location.href // Set the current window's URL } });
@fresh-fireman-491 by the way thanks for being so helpful!
f
You are very welcome! I can see that you already sent the configurable script earlier, my bad 🙂
In the execute code card that you have right after "Get User Data" add console.log(workflow.userData) at the top of it in a separate line.
Then try and run it from your website, and check the logs
c
There's something amiss. - First screenshot is immediately after I saved the code node - Second screenshot (and several I can include after) are from different browsers
f
What do you have in your text card
Which variables are you using here
c
Another interesting thing
f
Why not just {{workflow.userData.userData}} {{workflow.userData.userData.name}} etc.
c
It's not passing the data back regardless
+ see above -- oddity -- the object that I created isn't available
f
Can you try adding a text card with just {{workflow.userData.userData}}
c
Yep!
f
And then run it on your website
c
f
Can you check the logs to see the rrror
c
It blanked it out again
This keeps happening
f
That is weird
c
That card keeps going blank
f
Can you try and have it on its own node. Separate from everything
c
Sure thing
Any idea on why that object is not showing as available after I added it? That was another oddity
@fresh-fireman-491 error went away, back to being blank.
f
In the "Store output value in"?
c
Yeah, the object that I added is missing (userDataInfo)
f
Also the new text card with {{workflow.userData.userData}}
And you can't add it again?
c
Testing again hold one
f
Can you try just {{workflow.userData}}
c
Same result
Tried that too
f
That's really weird. I can't explain that
c
Me either, haha!
Anyone that I should tag who can help?
f
You can create a report id
@square-energy-41150
s
# Sending a Problem Report Here's how to send the Botpress Team a problem report: 1. In the Botpress Cloud Studio, locate the "Help" icon in the bottom left corner of the screen. 2. Click "Report a problem" and follow the steps on the screen. 3. Copy the Report ID to your clipboard and provide it to a member of the Botpress Team on Discord.
message has been deleted
f
Maybe @famous-jewelry-85388 can help us here? Subject: Issue with "Get User Data" card. Issue: Can see userData parsed from the configurable script when using console.log(workflow.userData), but not when trying to add {{workflow.userData}} to a text card, nor can he use the information stored in it in his flow. Can be seen in the logs here: https://discord.com/channels/1108396290624213082/1219253893440208986/1219293550299058316 nothing shows in the text card here https://discord.com/channels/1108396290624213082/1219253893440208986/1219298889207648368 "User ID" and "Store output value in" gets cleared randomly. Can be seen here https://discord.com/channels/1108396290624213082/1219253893440208986/1219296665790447747
c
@fresh-fireman-491 you'll laugh at this one...
f
....
Getting the same
I have notified them about it
c
That's it. I quit. Ha. Well... it worked previously... so hopefully @famous-jewelry-85388 or someone can help troubleshoot including why the bug reporting isn't working. I was supposed to demo this for my leadership team today and will have to fake the data LOL
Thank you again @fresh-fireman-491 for all your help!!!!!
f
You are very welcome! and I wish you the best with the demo!!
c
@fresh-fireman-491 actually one more question if that's OK?
f
Of course, shoot
c
We want to use LiveChat (LiveChatInc) for the human handoff. I know there is not an existing integration, but based on your experience with the dev capabilities of BotPress is it possible? We are using our own UI for LiveChat and currently have another AI (custom built, it sucks) integrated into it.
I believe if I read correctly that BotPress allows for custom UIs
f
Lets continue in your other help post 🙂
c
Oh haha my bad
c
Decay is a superhero 🦸‍♂️ Thanks for everything @fresh-fireman-491 ❤️ !!!! The community is so lucky to have you.
This is strange! I just tested it on my end, and it's working perfectly fine. Would you mind trying again? Thanks
c
Also had a coworker test on a different IP a few states over and same result
I can't export my bot either for some reason
or submit bug repots
*reports
f
I think you are right I can't export the bot where the problem is, but I got another bot, where I can report it, and export it.
c
Are you able to export other bots in your workspace ? @careful-kitchen-31087 or create report IDs?
c
@crooked-van-25152 yes, I can export other bots and create report IDs
Just not the one I've spent countless hours on... ha
c
Can you please send me a DM with your email address + bot ID + workspace ID ? thanks
c
@crooked-van-25152 done ❤️
c
@famous-jewelry-85388 are you able to access his bot without the report ID? Maybe with the bot ID or workspace ID?
w
You know what @careful-kitchen-31087 let's hop on a screen share call sometimes this week and get this sorted out once and for all, give me a few time slots and I'll try to make myself available.
c
@witty-football-93730 I'm available when you are! Including now
I can be available any time tonight or tomorrow.
Thank you all again for being so helpful. This is such a great community!
c
This is what I'm talking about!!! THANK YOU, @witty-football-93730 ❤️
w
@careful-kitchen-31087 Sending you a zoom link over email in the upcoming 5 mins 🙂
c
OK thank you! PM me if I don't jump on.
w
@careful-kitchen-31087 forgot to tell you whenever you change change the config of the webchat on the dashboard even enable / disable you need to scrolldown and hit save button
c
Yessir.
I PM'd you some info
w
Also can you add me to your workspace, you have my email 🙂
c
Done sir
w
@careful-kitchen-31087 do you mind if I make slight changes to your bot's ? If you do mind I will make a copy of it and make some changes in my personal environment
c
You can't download it 😦
The export function doesn't work
w
Follow-up: So 2 fixes have been sent: one for the webchat userData and one for the bot export user data fix is on the way to production and bot export is still being tested
c
Amazing, thanks so much ! @witty-football-93730 Marking this thread as SOLVED 😄
Don't hesitate to write to us if there's any issues here @careful-kitchen-31087
2 Views