sunny-green•15mo ago
Dynamic buttons using Custom action
Hi,
I am tring to create severals buttons dynamicly using custom action.
Here is JSON that I tried :
But I can't find the proper JSON for Buttons
{
"type": "choice",
"payload": {
"buttons": [
{
"name": "Label A",
"request": {
"type": "path-9x2sh3elw",
"payload": {
"label": "Label A",
"actions": []
}
}
},
{
"name": "Label B",
"request": {
"type": "path-dm3533een",
"payload": {
"label": "Label B",
"actions": []
}
}
}
]
}
}
No buttons are being rendered.
2 Replies
In Voiceflow, buttons can be dynamically rendered using the choice trace. Here's an example of how to format your choice trace for buttons:
In this example:
- Each button has a
name
which is the label displayed on the button.
- The request
object contains a type
which should match the event type you are listening for in your Voiceflow project.
- The payload
within the request
can contain any additional data you want to pass along with the button click event.
Make sure that your Voiceflow project is set up to handle these events. For instance, you should have a next
command listening for eventA
and eventB
:
This setup ensures that when a button is clicked, the corresponding event is triggered, and the flow proceeds to the designated path.
For more detailed information, you can refer to the Voiceflow documentation.sunny-greenOP•15mo ago
I can't see the buttons with this json