Velocity Script to extract first name from full name | Community
Skip to main content
Broderick_Klem1
New Participant
September 12, 2017
Solved

Velocity Script to extract first name from full name

  • September 12, 2017
  • 1 reply
  • 3253 views

In Marketo we have a name field that stores a full name (always in the format of "firstname lastname"). I'm sure I can use a custom token script to trim that string to just first name, but I'm not sure how to do it. Does anyone have the script already done that allows for this? Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

$lead.fullName.split(" ")[0]

You have to figure out what to do when someone has a compound first or last name (and you won't know which it is).

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
September 12, 2017

$lead.fullName.split(" ")[0]

You have to figure out what to do when someone has a compound first or last name (and you won't know which it is).

Broderick_Klem1
New Participant
September 13, 2017

Thanks!