Proper case first name and last name

Michael Bachme1
Kilo Guru

Our instances have all of our users in UPPERCASE (FIRST LAST). How can we change them to propercase (First Last) via Fix script?

7 REPLIES 7

Chuck Tomasi
Tera Patron

Hi Michael,



Yes, a Fix script would let you develop and test it in sub-prod and move it via update set to production. If you are looking to do this on each successive import, you'll want to modify the transform script that is associated with the import.



This thread on stackoverflow has a good example of the Regex to do that.



Convert string to title case with JavaScript - Stack Overflow


Hi Chuck:



Our import source is all uppercase. So ideally we would put this in the transform, as you said. I don't have a lot of experience with Regex.


Where in the transform script would this go?


Remove the field map for first name and last name.



Use the script area on the transform map to set



target.first_name = titleCase(source.first_name);


target.last_name = titleCase(source.last_name);



(or whatever the appropriate field names are). Write your titleCase function in the same script area. You can create and test your titleCase function using scripts background then bring it in to the transform map when completed.



The 'name' field on sys_user is a calculated field. By default is uses first_name and last_name fields so if you do one, you do them both.



If you get stuck, let me know.



There's some good RegEx videos we made a few months ago on TechNow. TechNow Episode List


That helps -- alot. Is there anything that can be done if users have to caps in the name? (i.e. LeAnn McCoy)?