Array of options are never shown in WhatsApp
# 🤝help
e
I have a capture card with numbered options, it will only be used when there are 2 to 6 options (to get buttons or a list), and the array will look like this:
Copy code
js
workflow.button_options = ['OPTION 1️⃣', 'OPTION 2️⃣', ...]
However the capture card message and options never show up on whatsapp. I can see that the message is sent on the logs -
Dialog [913b] Sending Message. Type: choice. Text: 💬 Which option do you want?
I am aware there is a problem happening with choices, but I am not sure if this issue here is a symptom or another bug. Cheers
a
Hey @early-train-33247, typically choice buttons follow this schema:
Copy code
button_options = [
{
    label: 'Option 1',
    value: '1'
},{
    label: 'Option 2',
    value: '2'
}
]
Where
label
is what's shown to the user and
value
what's sent back to the chatbot
c
are you available I need help
a
what's up?
c
I gave inpiut of mocha and that product exist in my list. but it is redirecting to the node which I created for product not exist case.
a
You AI Task and transition are probably not in sync. The transition is looking at
event.preview
, which is the user's message. If your AI task is outputting
workflow.checkProduct
or
workflow.userProduct
, then that should be the variable used in the transition.
c
but you can see event.preview contains 'mocha' and if you focus on transition to card where I have set a condition {{event.preview}} == "product does not exist or typing error " . it should not redirect me to confirm-product card
actual issue is with transition to card. else everythings works good
yes but I have turned on personality agent. so it changes the text of variables every time. how do I bind it with product does not exist?
a
AI personality does not affect variables, so you can do logic on
workflow.var
variables without issue
would the flow still work the same if you looked at
workflow.usrProduct
instead of
event.preview
?
c
let me try
@acceptable-kangaroo-64719 it worked!!!
Thanks
e
That was it Gordy! I thought it was a bug because in Telegram and in the Webchat the options showed up correctly with just an array of strings. But now with the proper format, it works everywhere. Thanks a lot!
14 Views