<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
0D54z0000A46JGtCQMOkta Classic EngineDirectoriesAnswered2024-03-29T14:29:18.000Z2024-03-25T21:20:56.000Z2024-03-29T14:29:18.000Z

BriaH.27600 (Customer) asked a question.

Okta Expression Language for -- Does not contain -- for multiple value

I am wanting to add users to the group that doesn't contain email domain value examples "@jackson.com" "@kraft.com"

 

I have tried a single value !String.stringContains(user.email, "@jackson.com") and it seemed to work. But when I try to add the operator:

 

!String.stringContains(user.email, "@jackson.com") OR

!String.stringContains(user.email, "@kraft.com") both values become true.

 

Can someone explain why that may be and potentially provide possible solution?


  • Hi @BriaH.27600 (Customer)​ , Thank you for reaching out to the Okta Community! 

     

    You were on the right track, you just need to adjust it a bit. 

    1. the query should look for users with said values together - (...)
    2. then not include them - !

     

    !(String.stringContains(user.email, "@jackson.com") OR

    String.stringContains(user.email, "@kraft.com")) 

     

    Please test it out and let me know if that work for you.

     

    If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you. 

     

    Hope my answer helps! 

     

    --

    Help others in the community by liking or hitting Select as Best if this response helped you.

    Expand Post
    Selected as Best
  • Hi @BriaH.27600 (Customer)​ , Thank you for reaching out to the Okta Community! 

     

    You were on the right track, you just need to adjust it a bit. 

    1. the query should look for users with said values together - (...)
    2. then not include them - !

     

    !(String.stringContains(user.email, "@jackson.com") OR

    String.stringContains(user.email, "@kraft.com")) 

     

    Please test it out and let me know if that work for you.

     

    If my answer helped, remember to mark it as best to increase its visibility for other members of the Okta Community who might have the same questions as you. 

     

    Hope my answer helps! 

     

    --

    Help others in the community by liking or hitting Select as Best if this response helped you.

    Expand Post
    Selected as Best
This question is closed.
Loading
Okta Expression Language for -- Does not contain -- for multiple value