
i9l8o (i9l8o) asked a question.
Has anyone been able to normalize an attribute to proper "format" using Expression Language? We've had instances where an employee's name is either all lower case or all upper case. Would like to force "Proper Case" when provisioning accounts to applications or AD.
Any suggestions/examples would be great.
Thank you!
https://developer.okta.com/docs/reference/okta-expression-language/*string-functions

Via trial and error, I came up with the following. This is assuming that the first and last name are all UPPERCASE.
appuser.firstName == String.toUpperCase(appuser.firstName) ? String.substring(appuser.firstName, 0, 1) + String.toLowerCase(String.substring(appuser.firstName, 1, String.len(appuser.firstName))) : appuser.firstName
appuser.lastName == String.toUpperCase(appuser.lastName) ? String.substring(appuser.lastName, 0, 1) + String.toLowerCase(String.substring(appuser.lastName, 1, String.len(appuser.lastName))) : appuser.lastName