Okta Expression Language, String Comparison Skip to main content
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Waverly EdwardsWaverly Edwards 

Okta Expression Language, String Comparison


I am using the Okta Expression Language in an attempting to test if users last name is in A-L or M-Z and put them into a group based on that test -- (that is the simplified test)

As I look through the documentation, **STRING** expressions do not appear to include the operators <, >, <=, and >=.

Here are the test that I know work

Test users last name: A-L
Arrays.contains({"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"}, user.CustomVariable_LastName_CharSplit))
Arrays.contains({"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"}, user.CustomVariable_LastName_CharSplit)) == true

Test users last name: M-Z
Arrays.contains({"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"}, user.CustomVariable_LastName_CharSplit)) == false
Arrays.contains({"M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}, user.CustomVariable_LastName_CharSplit)

user.CustomVariable_LastName_CharSplit contains only the capitalized letter of their last name.

Is there an easier way to perform a conditional test of the user's last name to split them off into different groups?

Thank you,