AnsweredAssumed Answered

Cleaning up company name using velocity script

Question asked by Broderick Klemetson on Jul 7, 2019
Latest reply on Jul 12, 2019 by Sanford Whiteman

I have company name pushing in Marketo from Salesforce, but it's the legal name, meaning that it includes things like "LLC" or "Inc". I'm trying to build a custom token to clean it up (similar to what I do with first name), but I'm a little lost in the syntax. How do you remove a portion of a string? So for example, if I have "Amco General LLC", how do I end up with "Amco General"? Thanks!


This is what I've got so far:

#set( $Company = $lead.salesforceAccountName.trim() )
#set( $CleanCompany = $lead.Clean_Company_Name__c.trim() )
#if( $CleanCompany.isEmpty() )
$Company.isEmpty() ||
your company##
$Company.matches("LLC") ||
[something that removes the LLC (and space before it) from the company name]