
OanaM.09449 (Customer) asked a question.
Hello everyone,
I am trying to create a Rule that should add all the users having in the display name the extensions {AUTOSOL/FCTL], [AUTOSOL/FCV], [AUTOSOL/PSS] etc into an OKta group.
This is the syntax that I am using but I am receiving an error:
Invalid expression syntax (String.stringContains(String.toUpperCase(user.displayName),"AUTOSOL/FCTL", OR (user.displayName),"AUTOSOL/FCV", OR (user.displayName),"AUTOSOL/LCS", OR (user.displayName),"AUTOSOL/PRM", OR (user.displayName),"AUTOSOL/ACT"), OR (user.displayName),"AUTOSOL/ISV")
I also tried to see if it works in the following ways but still no luck:
(String.stringContains(String.toUpperCase(user.displayName),"AUTOSOL/FCTL", OR (user.displayName),"AUTOSOL/FCV", OR (String.toUpperCase(user.displayName),"AUTOSOL/LCS"), OR (String.toUpperCase(user.displayName),"AUTOSOL/PRM")
Or:
(String.stringContains(String.toUpperCase(user.displayName),"AUTOSOL/FCTL", "AUTOSOL/FCV", "AUTOSOL/LCS")
Can someone give me an advice?
Thanks in advance.

Hello @OanaM.09449 (Customer) Thank you for reaching out to our Community!
I have tested this expression and this should do what you require, please see below:
String.stringContains(user.displayName, "AUTOSOL/FCTL") OR String.stringContains(user.displayName, "AUTOSOL/FCV") OR String.stringContains(user.displayName, "AUTOSOL/LCS") OR String.stringContains(user.displayName, "AUTOSOL/PRM") OR String.stringContains(user.displayName, "AUTOSOL/ACT") OR String.stringContains(user.displayName, "AUTOSOL/ISV")
The String.toUpperCase is not need in a group rule as this is used to create capital letters on an attribute and group rules will just read the attribute and not write it.
Please also see our article on Expression language for the future:
https://developer.okta.com/docs/reference/okta-expression-language/#samples-using-profile-mapping
Hope this helps!
This was helpful, is working as expected.
Oana Muresan | Information Security Operations Lead
Emerson Corporate | Str. Emerson, Nr.4 | 400641 | Cluj | Romania
T +400374423695 | M +400749889112
Oana.Muresan@Emerson.com<mailto:Oana.Muresan@Emerson.com> | http://www.emerson.com<http://www.emerson.com/>
Join the Emerson community: Subscribe to News, Events and Training <http://emrsn.co/Subscribe>