0

SF documentation says ProperCase(string) Returns the specified string with the initial letter of each word capitalized. We had some bad data collection practices existed in our previous CRM implementations in collecting names from prospects, and now have to fix these data problems at the source and meanwhile employ some scriptable ways to address the problem- like using ProperCase() in our marketing cloud email sends.

After doing some tests of my own, found out that my AMPScript with ProperCase() does help to solve to a large portion of our data, however, does not cater as a single solution. As for certain names like below, we do not want ProperCase() to act.

  • McKay / McDonald
  • De-Wei / Marie-Helene
  • O'Neill / O'Grady
  • Frédéric

And this is the case with Excel as well, wanted to see if we can do something at an AMPScript level or need to pursue some custom implementation with new business rules on how to treat names in Salesforce to address this.

  • When your data quality is that bad, i would recommend using propercase from salesforce to store values in a dataextension and then export this data to your crm. After that hire a student that iterates through all that data and changes it right. When i would programm that amp-script i would create if-rules where proper case would not be done on cases like begins with Mc or O' or contains - ... – Johannes Schapdick Jun 26 '18 at 5:29
1

You could use additional ampscript to exclude the names you don't want Propercase to run on. Something like:

var @name

IF IndexOf(lowercase(@name), "mc") > 0 OR IndexOf(lowercase(@name), "-") > 0 OR IndexOf(lowercase(@name), "\'") > 0 THEN
    SET @name = @name
ELSE
    SET @name = ProperCase(@name)
ENDIF

It's rough but should give you something to work with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.