https://discord.gg/botpress logo
Hi everyone 👋
# 🤝help
i
I’m building a scheduling bot in Botpress that connects with Google Calendar. I’m stuck with a problem when displaying available time slots in a Single Choice Capture Card. Here’s what I need: The user should only see labels like: Friday, 19/09 at 10:00 Friday, 19/09 at 11:00 Friday, 19/09 at 12:00 Internally, the bot should store only the ISO value (e.g. 2025-09-19T10:00:00.000Z) to send it to Google Calendar. But what happens now is that Botpress shows both the label and the ISO value together in the button (e.g. Friday, 19/09 at 10:00 2025-09-19T10:00:00.000Z). In my Capture Card I tried using: Label → {{workflow.pretty_slots[0].label}} Value → {{workflow.pretty_slots[0].value}} But the ISO value still appears in the button, instead of being hidden and only stored. 👉 My question: How can I configure the Capture Card so that the user only sees the label, but Botpress stores the value (ISO) internally? Thanks a lot for your help! 🙏
g
what capture card are you using? buttons?
if you are using buttons or raw input with choice, then you can format these buttons dynamically. like:
workflow.buttons = [{"label": workflow.pretty_slots[0].label, "value": workflow.pretty_slots[0].value} , {"label": workflow.pretty_slots[1].label, "value": workflow.pretty_slots[1].value}]
etc. if youre doing that in an execute code card do not use the moustache syntax "{{workflow.}}"
workflow.buttons should be of type array options
then in the choice card, click the (x) and type {{workflow.buttons}} <- here use the moustache syntax but not when creating the array
then you can store the ISO ts picked by doing:
workflow.isoTs = event.payload.value
in execute code card
i
Thanks a lot for your help! I was able to solve the issue thanks to your explanation 🙌 Creating the buttons dynamically with workflow.buttons and using {{workflow.buttons}} in the choice card worked perfectly. Also assigning workflow.isoTs = event.payload.value gave me exactly what I needed for Google Calendar. Really appreciate it! 🙏
4 Views