$lead.subPartner.replaceAll("^Marriott - ","").replaceAll("^","a ").replaceAll("(?i)^a ([aeiou])","an $1")
Thank you Sanford!
I updated the code as shown below, but am seeing an error when trying to preview it in email.
#set( $valueWithoutMarriottPrefix = $lead.subPartner.replaceAll("^Marriott - ","").replaceAll("^","a ").replaceAll("(?i)^a ([aeiou])","an $1") )
${valueWithoutMarriottPrefix}
What am I doing wrong?
Thank you,
LK
@SanfordWhiteman and @Guitarrista82 ,
Ignoring for a moment the value in a robust discussion on the use of Velocity, I have silly thought. Namely, why not fix this problem in the actual Marketo data?
Surely a smart campaign that had as its smart list the field with the junk value, and then a flow step doing a change data value to the correct value would suffice?
Cheers
Jo
Thank you for offering your insight, @Jo_Pitts1. Definitely not a silly thought.
I was able to fix the initial issue with the data by running a smart campaign in Marketo, but I received a request to transform how the existing values for the custom field appear in emails.
Unfortunately, our CRM is rather archaic and the management of data therein is not an easy undertaking. A request to change data values would most likely take several months to complete. And any data that flows in from our CRM to Marketo would override any values that get updated.
Definitely food for thought for longer-term implementation, but at the moment, it wouldn't be feasible with our time constraints.
Thank you,
LK
Quite. The use case here seemed very specific, hence why I suggested it 🙂
@SanfordWhiteman I tried private messaging you but am not sure if the message went through because there was no confirmation on my end. Can you please confirm if the message was received?
Thank you,
LK
Thanks...I just resent and it looks like it was sent successfully this time.