SOLVED

Transfer data from one form to another form

Go to solution
RaguPrashanth
Level 2

Transfer data from one form to another form

Hi All,

 

We are trying to capture the user details in two different pages, so we used two different forms. For this scenario we have followed the below process.

 

1) When the 1st form get submitted we passed the email address in the form.onSuccess -> location.href = "2nd_Form_LP_url.html?email ="+emailAddress.

RaguPrashanth_0-1733739666578.png

RaguPrashanth_2-1733739758278.png

 

 

2) Then in 2nd Form LP, we used the JS to capture the email values from URL and stored it in hidden field. So the 2nd form field values will saved against to same email address in DB.

 RaguPrashanth_4-1733739878752.png

 

RaguPrashanth_3-1733739825671.png

 

But we need to avoid passing the email address in URL and store the 2nd form field values in Marketo DB.

 

Kindly share your feedback and is there any other solution to achieve this.

 

Thanks in advance.

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Transfer data from one form to another form

OK. You kind of have to become familiar with cookies, because both Munchkin event logging and Marketo form posts are deeply intertwined with cookies.

 

  • There’s no Munchkin at all without cookies.
  • Forms can post just fine without cookies, but the positive side effects of a form post — associating activities with the new or updated lead that submitted the form — will be absent.

View solution in original post

8 REPLIES 8
SanfordWhiteman
Level 10 - Community Moderator

Re: Transfer data from one form to another form

First off: that code is badly broken. You can't just add unencoded param values to query strings. Never add values without using the function encodeURIComponent(), which is designed for this purpose, or a URLSearchParams object.

The code on the receiving page is also broken. That's not how you parse a query string, and also not how you set values on a Marketo form. Marketo forms have a robust JS API.

Leaving those problems aside: are these forms on different parent domains? Is that why you're currently passing the Email value? Or are you trying to deal with cookies being rejected by the end user? What is the exact (please be detailed) problem you're trying to solve?

RaguPrashanth
Level 2

Re: Transfer data from one form to another form

Hi Sanford,

Thanks.

 

Trying to do a survey form submission in Marketo Assets.

1st Form have one field "Email address" and  Submit

2nd Form have few other fields (First Name, Last Name, Company, Mobile Number and Country).

 

After enter the email address and submit the 1st Form, then 2nd Form will display with other fields and those fields need to be save/submit against the same record in DB.

SanfordWhiteman
Level 10 - Community Moderator

Re: Transfer data from one form to another form

If the pages are on the same domain, they’ll share the associated Munchkin cookie. Simply leave the Email field off the second form.

 

You didn’t really answer my question about cookie support, so I assume you don’t care about that.

RaguPrashanth
Level 2

Re: Transfer data from one form to another form

Thanks. I will try the same.

 

I'm not familiar with Cookies and we are just trying to use two different pages to display the fields(accordingly) to get the values from user.

SanfordWhiteman
Level 10 - Community Moderator

Re: Transfer data from one form to another form

OK. You kind of have to become familiar with cookies, because both Munchkin event logging and Marketo form posts are deeply intertwined with cookies.

 

  • There’s no Munchkin at all without cookies.
  • Forms can post just fine without cookies, but the positive side effects of a form post — associating activities with the new or updated lead that submitted the form — will be absent.
RaguPrashanth
Level 2

Re: Transfer data from one form to another form

Sure, I will check on Cookies and Munchkin.

 

Thanks. Yes, the 2nd Form values are submitted against the same Email address (used in 1st Form) in Marketo DB.

 

Please confirm, because of Munchkin we have session data, so the second form data are submitted with same email address.

 

I'm exploring this option, because we have business use case for it. Please share any link to know "How exactly the coding part work in this case?" 

SanfordWhiteman
Level 10 - Community Moderator

Re: Transfer data from one form to another form


Please confirm, because of Munchkin we have session data, so the second form data are submitted with same email address.


I wouldn’t phrase it that way. The second form data is submitted for the same Lead ID. That implies the same Email Address, but Email Address is not a unique identifier in Marketo. The Munchkin session cookie is associated with a specific Lead ID from the first form post.

 


Please share any link to know "How exactly the coding part work in this case?" 


Sorry, don’t know what you mean by “the coding part”.

RaguPrashanth
Level 2

Re: Transfer data from one form to another form

Thanks Sanford.

 

I will keep exploring and get updated with Munchkin and Cookies.