fair-rose•3mo ago
Payload for extension
I'm currently working with custom form extensions (via interact({ type: 'complete', payload })) and would love some official guidance on how to reliably capture and process the form data inside Voiceflow – either via a JavaScript Step or a Function Step.
In both the test environment and live mode, I've run into situations where:
the flow unexpectedly breaks,
the code block silently fails, or
the function step returns no trace at all when payload or the global object is malformed or not properly initialized.
Would it be possible for you to provide:
A clear and minimal working example for how to receive form data from a custom extension,
How to safely extract event.payload or args.inputVars.payload,
How to handle missing or undefined global variables (like formDataCollected),
And any best practices to avoid flow-breaking errors (like Cannot set property 'x' of undefined, etc.)?
A short code snippet (JS Step or Function) and a few key "do's and don'ts" would really help the community better understand how to work with dynamic inputs like these.
Thanks a lot in advance – really appreciate your support!
1 Reply
It's in the official docs: https://docs.voiceflow.com/docs/example-extension-form-input#/
You can use
name = last_event.payload.name
Voiceflow
Example extension: form input
📘Learn about extensions first!If you haven't already, we recommend reading the custom forms and extensions page before following this guide. That page will give you a bunch of extra context about what is going on here!
The first extension that many users build is a form extension. We'll walk you th…