Skip to main content
Erik_Hill1
Level 2
Aug 19, 2019 7:11 PM UTC
Solved

Marketo and Unbounce - possible to combine fields in Marketo?

Hello,

We're currently using Marketo with Unbounce landing pages. We need to combine last name, last 4 of the phone number, and the word 'Household' to populate the company field in Marketo, if possible.

Example Company field format in Marketo: Smith7890 Household

Is it possible to concatenate a full field (last name), capitalize the first letter and lowercase the rest, if needed, add the last 4 numbers of the phone, add a space, then add the word 'Household', all inside Marketo? Or is this something that needs to be done/can be done on the page via JS before sending the data to Marketo?

Sanford Whiteman, is this something you're familiar with?

SanfordWhiteman
SanfordWhitemanAccepted solution
User Group Leader
Aug 23, 2019 2:33 AM UTC
<script>
document.forms[0].addEventListener("submit", function(e){
this.Company__c.value =
this.LastName.value.substr(0,1).toLocaleUpperCase() +
this.LastName.value.substr(1).toLocaleLowerCase() +
this.Phone.value.substr(-4) +
" Household";
});
</script>‍‍‍‍‍‍‍‍‍

Add this to Unbounce as a "Before Body End Tag" script.

7 replies

SanfordWhiteman
User Group Leader
User Group Leader
Aug 19, 2019 7:18 PM UTC

Sure, it could be done within the Unbounce form. (Standard DOM input value for a hidden field in this case, as it's not a Marketo form.)  Add the field to the form as hidden and post a link to your page.

Translate
Erik_Hill1
Level 2
Aug 22, 2019 4:40 PM UTC

Ty @Sanford Whiteman‌! Are you saying to post a link to the page here in this thread? If so, would you mind if I messaged you the link directly?

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Aug 22, 2019 5:49 PM UTC

Yeah, you can message me.

Translate