Re: Form not pre-filling reliably

Maria_Hirschbe1
Level 2

Re: Form not pre-filling reliably

Sanford,

Thank you for your help. I changed the value of the hidden field to "yes" (approved the form and approved the LP), but still sometimes this field is not selected on the second form.

SanfordWhiteman
Level 10 - Community Moderator

Re: Form not pre-filling reliably

Can you reproduce the condition easily?

What does the prefill block contain when it fails/succeeds? If you open your F12 Console and enter

mktoPreFillFields

you'll see an object.  Open up that object to see its properties (esp. the newsletter field) and post a screenshot of failure and success states.

Maria_Hirschbe1
Level 2

Re: Form not pre-filling reliably

Sanford,

It takes me 3-5 attempts to reproduce.

On success, the value is "bain_optinnewsletterbaininsights":true; on failure, it is "bain_optinnewsletterbaininsights":null.

This is the hidden field:

Maria

Maria_Hirschbe1
Level 2

Re: Form not pre-filling reliably

Hi Sanford Whiteman​,

Would you be able to point us in the right direction as to which Forms JS API to use to populate the value of the field on the second form based on the value of the hidden field on the first form?

Marketo Support recommended to delay the display of the second form by a few seconds, but it does not sound like a user-friendly solution.

SanfordWhiteman
Level 10 - Community Moderator

Re: Form not pre-filling reliably

Marketo Support recommended to delay the display of the second form by a few seconds, but it does not sound like a user-friendly solution.

Not just non-user-friendly, it's technically wrong. The reason the aliId and the read-your-write cache exists is because this arbitrary wait is not guaranteed to work.

I'd like to take a closer look at your desktop while you're reproducing the failure. It may be browser-specific and, as you know, I need to get a jump on forms bugs and fixes.

SanfordWhiteman
Level 10 - Community Moderator

Re: Form not pre-filling reliably

You should also read this post related to the same feature: https://blog.teknkl.com/dont-call-a-marketo-lp-an-external-url/

Kai_Crow2
Level 2

Re: Form not pre-filling reliably

So if I'm understanding correctly, then my first setup should have worked fine - form 1 had the follow-up (yes, I wish they'd be consistent with naming) action set to a marketo landing page (the one that lives at https://get.asknicely.com/demo-booking.html ). Am I understanding correctly that then the built in behaviour of the marketo landing page should be if the association hasn't been completed, then load the data from the aliId parameter? Or would I need to separately setup a fall-back method to use the aliId data?