<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00007eRwCQCA0Okta Classic EngineUniversal DirectoryAnswered2022-05-19T08:51:26.000Z2022-05-17T10:39:15.000Z2022-05-19T08:51:26.000Z

OanaM.09449 (Customer) asked a question.

Use Okta Expression Language (advanced) while creating rules with multiple conditions

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.


  • Paul S. (Okta, Inc.)

    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!

     

    Expand Post
This question is closed.
Loading
Use Okta Expression Language (advanced) while creating rules with multiple conditions