
KarthikP.51024 (Customer) asked a question.
Hi Experts,
I have AD mastered users in Okta. I need to write rule in Okta that should assign users to group only if their login id has digits. I went through https://developer.okta.com/reference/okta_expression_language/*string-functions but couldn't find relevant function that solves my purpose.
For example:
Login IDs are 123456 and C12345.
If Login ID is 123456 then assign user to group otherwise ignore group assignment.
I tried with String.startsWith(user.login,"C") - but this rule doesnt apply for users who has login id as number. So i am not able to assign to group.
How can I write string function that checks if login id has only numbers and then assign to group?
Any suggestions?
Thanks

Hmm.. Maybe a little bit more information could help. Does the first character, if it is a letter, always start with the letter C? is it random letters? Does it not always start with a letter?
What if you did a "NOT" check?
So for example if the userlogins always start with the capital letter "C" (or not at all)...
!String.startsWith(user.login,"C") - expression is asking if the first character does NOT start with "C".