SOLVED

Trying to use Tokens to pre-populate data on a form

Go to solution
kenmckown
Level 2

Trying to use Tokens to pre-populate data on a form

I am working on a survey form in an email. I currently only have two visible fields, but want to populate the person's information using Marketo Tokens.

I have the form setup with the fields like this:

kenmckown_0-1698419259678.png

When checking the form filles I am getting "not provided" for this data. The person exists in Marketo.

kenmckown_1-1698419313175.png

Any ideas why this is not working?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Trying to use Tokens to pre-populate data on a form

Of course it’s possible! That’s what Hidden field Auto-Fill from URL Parameter is all about. To correctly send a field in the URL, use a small Velocity {{my.token}}:

<a href="https://pages.example.com/landingpage?${link.encode($lead.Email)}">go to form</a>

 

The direct use of a {{lead.token}} as a Hidden field’s Default value, however, is not supported (token values are not properly encoded for this purpose, so depending on the value you could break the whole form).

 

Of course if you’re sending a mkt_tok-enized link, there’s no reason to use Hidden field Auto-Fill at all. You can enable Hidden field Pre-Fill and Marketo will take care of populating the value based on the lead record in the db. Are you sure your links have the all-important mkt_tok attached?

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Trying to use Tokens to pre-populate data on a form

To be clear (because others may be confused), you’re linking to a page with a form. The form is not in the email.

 

Is this a Marketo Landing Page that you’re linking to?

kenmckown
Level 2

Re: Trying to use Tokens to pre-populate data on a form

Yes this is a Marketo landing page.

kenmckown
Level 2

Re: Trying to use Tokens to pre-populate data on a form

What we are trying to do essentially is pass form values into hidden form fields on the form i.e. Email Address, Company, First Name, etc. Is that possible with marketo Tokens or URL parameters. We have tested several different ways and it always comes back blank.

SanfordWhiteman
Level 10 - Community Moderator

Re: Trying to use Tokens to pre-populate data on a form

Of course it’s possible! That’s what Hidden field Auto-Fill from URL Parameter is all about. To correctly send a field in the URL, use a small Velocity {{my.token}}:

<a href="https://pages.example.com/landingpage?${link.encode($lead.Email)}">go to form</a>

 

The direct use of a {{lead.token}} as a Hidden field’s Default value, however, is not supported (token values are not properly encoded for this purpose, so depending on the value you could break the whole form).

 

Of course if you’re sending a mkt_tok-enized link, there’s no reason to use Hidden field Auto-Fill at all. You can enable Hidden field Pre-Fill and Marketo will take care of populating the value based on the lead record in the db. Are you sure your links have the all-important mkt_tok attached?

SanfordWhiteman
Level 10 - Community Moderator

Re: Trying to use Tokens to pre-populate data on a form

@kenmckown please return to your thread to check updates.