https://discord.gg/botpress logo
I don't know how to modify Conversation Variables ...
# 🤝help
b
Goal: I'm trying to modify (create) a conversation variable depending on customer's answer in a multiple choice card Problem: I've tried checking every resource on - youtube , - Botpress documentation - here but most only helps me on the showing or modifying other variables (User & Workflow, not Bot, and not creating a Conversation variable.) https://cdn.discordapp.com/attachments/1379849425731719208/1379849425987305512/image_2025-06-04_094156484.png?ex=685c1a6b&is=685ac8eb&hm=34392b220ed4ad2821990b3f929b1db1a743c58cf8ee271ea0c053a0bd7ba967& https://cdn.discordapp.com/attachments/1379849425731719208/1379849426276843560/image_2025-06-04_094406346.png?ex=685c1a6b&is=685ac8eb&hm=7ecc02b0ca6ff928f6830ccb2a121495a534dbc6de9f61b414de44f5008c32e3&
p
You should use the execute code card in a standard node and connect it to the output of your multiple choice card.
b
should I code it like this? const conversationReason = event.payload.text console.log(conversationReason)
btw, thank you @prehistoric-airplane-85682
p
No worries, conversation.variableName is how you should access to read or write.
b
Oh, so (in this case i want to get the initial reason why they called) const conversationReason = conversation.InitialReason console.log(conversationReason)
I'm trying to see it in the "variables" mini tab from the side being changed...
l
console.log(conversation.InitialReason) will work as well. since const conversationReason is a runtime defined variable, you wont see it the variables tab
b
And i can see the console.log in the Event debugger, right?
p
You can see the logs in the studio at the bottom and conversation variable although assign do not change in the side tab. It is an issue we're aware of.
b
Thank you very much Lijo and Leanne
5 Views