Re: Populate first name and last name into a hidden field

Anonymous
Not applicable

Populate first name and last name into a hidden field

Hello,

We have Salesforce and Marketo synced, and the Company field is required on the Saleforce side. What we do with our current forms (non-Marketo) are grab the values that the user entered into the First Name and Last Name fields (ex. Smith, John) and pass them into the submission using PHP.

For Marketo, I am creating a hidden field called "Company" and was looking for a way to populate the values from First Name and Last Name when the user submits the form. Is there a way to do this?

Thanks!
Tags (1)
5 REPLIES 5
Josh_Hill13
Level 10 - Champion Alumni

Re: Populate first name and last name into a hidden field

Do you mean you want to fill in a blank Company with the Lname and Fname values?

You could do this using the conditional values on the Marketo Form. Use the token {{lead.First Name}} {{lead.Last Name}} in the company field.

Alternatively do the same thing as a trigger - anytime somene fills out a form and Company IS EMPTY, pull values in from the name fields.
Anonymous
Not applicable

Re: Populate first name and last name into a hidden field

Thanks! Yes, Company is a hidden field (nobody manually fills it out, but it needs to post to Salesforce with each form submission). So I can add {{lead.First Name}} {{lead.Last Name}} into the hidden field value?
Anonymous
Not applicable

Re: Populate first name and last name into a hidden field

When I add the tokens into the hidden form field value, it literally returns {{lead.Last Name}}, {{lead.First Name}}. How do I get the form to actually grab the Last and First name values?

I'm also curious how to do this for the current date. That is a hidden field as well that I need to populate with the date that the form was filled out, in this format: dd/mm/yyyy.

Anonymous
Not applicable

Re: Populate first name and last name into a hidden field

Did you ever find an answer to this?
Anonymous
Not applicable

Re: Populate first name and last name into a hidden field

Yes we had to write custom Javascript.