-
Re: Splitting field data in token
Nicol Maurer Jun 15, 2016 9:24 AM (in response to Nicol Maurer)Right now I have:
#set ($name = ${lead.Salesperson})
#set ($repfullname = $name.split(" "))
$repfullname[0]
Returns: $repfullname[0]
-
Re: Splitting field data in token
Jamie LewisJun 15, 2016 10:50 AM (in response to Nicol Maurer)
Have you tried using the substring method? I think that will solve it.
-
Re: Splitting field data in token
Nicol Maurer Jun 15, 2016 10:57 AM (in response to Jamie Lewis)Thanks for your reply. I'm actually trying to get the {lead.Salesperson} value assigned to the $name variable. It's not currently assigning, or if it is, it's being assigned as an object and not a string.
-
-
Re: Splitting field data in token
Jenna Molby Jun 15, 2016 2:21 PM (in response to Nicol Maurer)Your logic is correct. What displays in the email when you do a test send?
-
Re: Splitting field data in token
Nicol Maurer Jun 16, 2016 10:06 AM (in response to Jenna Molby)It just displays ' $repfullname[0]'.
When I assign lead.SalesPerson to $name the value of $name isn't what is expected. It's blank. If I give lead.SalesPerson a default value it will display the default value. It seems a bit buggy. I also tried an example script that was available here in the forum:
Example 1: Properly Capitalizing First Name
#set ($fname = ${lead.FirstName})
#if($fname.equals(""))
Friend
#else
$display.capitalize($fname)
#end
This didn't work either.
-
Re: Splitting field data in token
Rajesh Talele Jul 9, 2016 1:05 PM (in response to Nicol Maurer)Hi Nicol Maurer
Did you get this working?
I think your question was that the script you had placed not showing value in display. Did you actually try sending this email to a test lead?
Please let me know if you need help. There are a couple of gotcha's w.r.t. testing and debugging velocity scripts in Marketo.
Rajesh Talele
-
-
-
Re: Splitting field data in token
Robb BarrettJun 15, 2016 2:30 PM (in response to Nicol Maurer)
You should also force it to lower case, then force it to title case, just in case someone enters an ALL CAPS NAME or a lower name oR SoMe weiRd MIX
#set ($lowername = $repfullname[0].toLowerCase())
#set ($propercase = $lowername.substring(0,1).toUpperCase())
-
Re: Splitting field data in token
Nicol Maurer Jun 16, 2016 8:41 AM (in response to Robb Barrett)Thanks for your response. Good idea. Would the display tool work just the same?
-
Re: Splitting field data in token
Robb BarrettJun 16, 2016 8:44 AM (in response to Nicol Maurer)
Don't know. I actually never use Velocity.
-
-