Username/Custom Expressions Skip to main content
https://support.okta.com/help/answers?id=906f0000000qtg3iak&refurl=http%3a%2f%2fsupport.okta.com%2fhelp%2fanswers
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
1
2
3
4
5
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Okta AdminOkta Admin 

Username/Custom Expressions

Trying to get a custom expression setup for a username field.  Does anyone have ideas on how to i would get the first 10 characters of the first and last name combo?  For Example, my name is Jeff Janovich and username would be jeffjanov. Any help would be much appreciated.
Best Answer chosen by Okta Admin
Brad LondonBrad London
HI Jeff - This should help you with your scenario.   String.substring(user.firstName + user.lastName, 0, 10)   You could also wrap this with a lowercase function toLowercase(String.substring(user.firstName + user.lastName, 0, 10))

All Answers

Jim GriffithsJim Griffiths (Okta, Inc.)
Brad LondonBrad London
HI Jeff - This should help you with your scenario.   String.substring(user.firstName + user.lastName, 0, 10)   You could also wrap this with a lowercase function toLowercase(String.substring(user.firstName + user.lastName, 0, 10))
This was selected as the best answer
Madhu Mahadevan - SEMadhu Mahadevan - SE (Okta, Inc.)
Okta AdminOkta Admin
Thanks everyone.  As always quick response and the community comes through :)
Anurag TripathiAnurag Tripathi
Is there any way to find a unique username during the import? ex. i have created a username with format (1st char of lastname + 6 char of firstname) so how i can validate if this username unique within OKTA as there can be users with same first name and lastname.

Regards,
Anurag