
v86kv (v86kv) asked a question.
So I was told by Okta support that they 'don't like' spaces in the username field. I am realizing that AD usernames that have spaces in them are not being assigned in Okta because of this. An example is BSMITH 2@domain.com. I was giving this article to reference: https://developer.okta.com/reference/okta_expression_language/
And told by support to use the expression below during the AD import process:
String.removeSpaces("This is a test")
I have been working with that and the AD username field and have tried multiple expressions such as:
String.removeSpaces(user.username)
String.removeSpaces(user.samaccountname)
f:String.removeSpace(user.username)
And so on. So far I cannot find a working expression to import the user and remove the spaces from the AD username. I can't imagine this is a strange or unique request and there must be other admins that have done this (I hope) successfully.
Thank you.

Hi Tim,
Probably this is just a typo, as the username attribute must be typed userName.
The expression should be as follows: ${f:String.removeSpaces(user.userName)}
I hope this works for you.
Thank You,
Bogdan Popescu
Technical Support Engineer
Okta Global Customer Care