Hi. I would like to pass data between multiple embedded forms through hidden fields in WebFlow.
We’ve created a multiform questionnaire that communicates from one section to the other with hidden fields. This works well if the forms are typeform links, since the hidden fields are added to the slug, but this breaks down when we want to embed those forms on website pages (in our case webflow).Is there a way to pass hidden fields, from one form embedded on one page, to another form embedded on a different page?
Best answer by mathio-tf
If you were to use single typeform, it can autosave progress and preserve their answers even when they leave the form.
If you want to split the user journey between multiple typeforms you will need to take care of preserving their session yourself. If the data is not sensitive, the simplest solution might be saving the data in a cookie. Each page with a typeform could save the data from query parameters info a cookie. When users returns to the page later, it could load the data from cookie as a fallback solution when query parameters are not available. You will need to pass those values to embedded form via embed SDK yourself.
User journey:
page1
form 1 will redirect to page 2 and pass hidden fields as query string params
page 2
custom JavaScript will load the values from query string
store the values in cookies
pass those values as hidden fields to form 2
display form 2
form 2 will redirect to page 3 and pass hidden fields as query string params
page 3
same as page 2...
If user returns to a page later, eg page 2:
custom JavaScript will try to read the values from query string (but it will be empty)
read the values from cookies instead
pass those values as hidden fields to form 2
display form 2
…
The JavaScript code could look like this:
1functiongetHiddenFields() {
2let { search } = window.location;
3if (search) {
4// loading values from query string, saving to cookie
Yes, I’ve gone through those instructions, but unless I’m missing something, they don’t resolve our issue.
In those intructions, they specify to use a specific value for those hidden fields, like #email=xxxxx and replace the xxxxx with a specific email. But how would that work in an embedded form? Each user will have their own email. Same with name/last name, or any of the other variables we are wanting to pass from one form, to the other.
For example, we want to collect the name, last name, and email in form one. Then, when a user goes to a second page, where we’ve embedded form two, we would like that form to recall that information so that they don’t need to input it once more.
So ultimately, page 1 will have form A. page 2 will have form B. page 3 will have form C, and we need certain info to be recognized through out their form journey.
We’ve been able to make this work using drip, and linking the forms directly from type form. But it does not work for us when embedding the forms on different website pages.
Thank you @Liz and @mathio. Question. If I manage to set this up, will this only work at the moment of redirect? Or for example, could they be redirected to form 3, not fill it out at the moment, but later come back to that same page? That is the heart of the issue, because while the test forms are small, we ultimately want to build a large multi question typeform, across 7 or so pages. The ideal scenario would allow a user to fill it out partially, and then come back at a later time to continue filling it out.
So they would be able to complete page 1 and page 2, and at a later time complete page 3.
If you were to use single typeform, it can autosave progress and preserve their answers even when they leave the form.
If you want to split the user journey between multiple typeforms you will need to take care of preserving their session yourself. If the data is not sensitive, the simplest solution might be saving the data in a cookie. Each page with a typeform could save the data from query parameters info a cookie. When users returns to the page later, it could load the data from cookie as a fallback solution when query parameters are not available. You will need to pass those values to embedded form via embed SDK yourself.
User journey:
page1
form 1 will redirect to page 2 and pass hidden fields as query string params
page 2
custom JavaScript will load the values from query string
store the values in cookies
pass those values as hidden fields to form 2
display form 2
form 2 will redirect to page 3 and pass hidden fields as query string params
page 3
same as page 2...
If user returns to a page later, eg page 2:
custom JavaScript will try to read the values from query string (but it will be empty)
read the values from cookies instead
pass those values as hidden fields to form 2
display form 2
…
The JavaScript code could look like this:
1functiongetHiddenFields() {
2let { search } = window.location;
3if (search) {
4// loading values from query string, saving to cookie