
2qvnr (2qvnr) asked a question.
We are using Workday as a master and looking to generate the email for newly provisioned Okta users that will follow a firstName.lastName@domain.com format.
We have a few different domains that are used based on role and location and have custom expression that is working as expected for the most part and enforces lower case as well on the email address.
It is essentially this: String.toLowerCase(appuser.firstName) + "." + String.toLowerCase(appuser.lastName) + "@domain.com"
Occasionally we'll have a pre-hire come through from Workday that has an apostrophe in their last name or may have a space in their last name (maiden name + last name) and this causes a problem for generating a valid email address.
I'm not well versed in the Okta expression language and can't figure out how to generate an expression that will enforce lower case and strip out apostrophes and spaces from lastName.
Anyone have any tips?

Hello Andre,
My name is Dan and I am from Okta Support.
- You can use this expression to enforce lower case/ strip out apostrophe and spaces from last name:
String.toLowerCase(appuser.firstName) + "." + String.removeSpaces(String.replace(String.toLowerCase(appuser.lastName), "'","")) + "@domain.com"
- If you need, you can use this expression to apply it to both first name and last name:
String.removeSpaces(String.replace(String.toLowerCase(appuser.firstName) + "." + String.toLowerCase(appuser.lastName), "'","")) + "@domain.com"
Regards,
Dan
Thank you - this is just what I needed and appreciate the additional explanation of applying it to first and last name.