Dynamic Buttons -- Can Buttons Appear/Hide?
I'm navigating the buttons step and I can't find information on this issue nor am I even sure it's possible. I'm trying to extract options from a csv list and convert them to buttons depending on the contents of the list, but is there a way to toggle the visibility of the buttons? Sometimes a csv list will have five options, sometimes seven, etc. Since I don't want empty buttons taking up space, is there a way to show/hide buttons as needed?

1 Reply
Unfortunately the Button Step (and the button-enabled Choice Step) are static: every button you add in the editor becomes a permanent port in the diagram and will always be rendered in chat.
Those buttons can be renamed at runtime with variables, but they cannot be conditionally shown/hidden – a “blank” label simply renders as an empty clickable area. If you need the list of buttons to grow or shrink at runtime (e.g. 5 items today, 7 tomorrow) you’ll want to switch to a Custom Action instead: 1. Read the CSV (with a Code Step or an external call).
2. Build a Choice trace payload that contains only the rows you need, e.g. 3. Emit that trace through a Custom Action step (Custom Action name =
• Dynamic rendering with Custom Action (“…unknown number of items, such as a product list … or a set of order IDs to show as Buttons”).
https://docs.voiceflow.com So: Button Step = fixed buttons; Custom Action = fully dynamic buttons.
Those buttons can be renamed at runtime with variables, but they cannot be conditionally shown/hidden – a “blank” label simply renders as an empty clickable area. If you need the list of buttons to grow or shrink at runtime (e.g. 5 items today, 7 tomorrow) you’ll want to switch to a Custom Action instead: 1. Read the CSV (with a Code Step or an external call).
2. Build a Choice trace payload that contains only the rows you need, e.g. 3. Emit that trace through a Custom Action step (Custom Action name =
choice
, body = the JSON above, and enable “Stop on Action” if you need to wait for the user’s click).
Because the Choice trace is generated at runtime, only the buttons you include in the JSON will appear—no empty placeholders.
Docs that cover this pattern• Dynamic rendering with Custom Action (“…unknown number of items, such as a product list … or a set of order IDs to show as Buttons”).
https://docs.voiceflow.com So: Button Step = fixed buttons; Custom Action = fully dynamic buttons.
Voiceflow
Welcome to Voiceflow's docs
Build, manage, and deliver chat and voice agents for customer support and beyond.