Voiceflow PartnersVPVoiceflow Partners
Powered by
TonyT
Voiceflow Partners•10mo ago•
18 replies
Tony

Sending custom variables from the page

I'm using the Voiceflow web widget and need to pass a custom variable (postcode) into the assistant. This variable is collected from the page (via a form input), so it is not available at the time of widget load.

I want to:
1. Load the widget normally when the page loads
2. Collect the postcode after the user submits a form
3. Send that variable to the assistant after launch, without interfering with the session or causing a second unintended launch

I’ve tried sending the variable during chat.load() as prescribed, but since the postcode comes from a user input field, it isn’t available at page load — so that approach doesn’t work.

I also tried sending the variable later using chat.interact({ type: 'intent', payload: { postcode } }), but that only works if the assistant is currently waiting for a last event — otherwise the value is ignored.

Additionally, when interact() does work, calling chat.open() afterward seems to trigger a second launch, resulting in duplicated flows or broken logic.

I’d like to know: what’s the best practice for sending a variable after load and after assistant start, without causing a second launch or missing the variable entirely? Is there a way to keep the session live or defer variable usage until interact() is called, without relying on timeouts?

Thanks!
Voiceflow Partners banner
Voiceflow PartnersJoin
Exclusive community for Voiceflow Solutions Providers & Content Creators.
13,076Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
jacklyn

# Let your agents search the web 🔎 Hey everyone! We just released the web search tool for the agent step! Your agents can now automatically search the web for information, letting your agent supplement the LLM's knowledge and the data in its knowledge base with live, up-to-date information. Plus.... * You can restrict searches to specific domains, so your agent only searches sites that you own * This is a tool, so you remain in control of when the agent searches the web * Results are automatically summarized in a way that your agent can automatically understand Under the hood, we're using OpenAI's web search API. Give it a try, and let us know what you think! https://docs.voiceflow.com/changelog/native-web-search-tool

jacklyn · 4mo ago

jacklyn

jacklynbiggin's Thread

jacklyn · 4mo ago

hurt-tomato

connor_maclean's Thread

hurt-tomato · 4mo ago

Similar Threads

Pass data from web page to voiceflow assistant custom variables
brilliant-limeBbrilliant-lime / ❓┃ask-a-question
2y ago
how do i send Custom Variables
radical-limeRradical-lime / ❓┃ask-a-question
2y ago
Sending Data from Zapier to Voiceflow
faint-whiteFfaint-white / ❓┃ask-a-question
2y ago
Injecting Voiceflow variables into a custom extension?
RomAIxRRomAIx / ❓┃ask-a-question
6mo ago