
4mhbt (4mhbt) asked a question.
We use Rules to manage user provisioning from Okta to ServiceNow. We have a ... challenging environment with multiple AD domains all syncing to and from Okta.
I need to be able to provision users from one such domain, but only if their Username (login) does NOT contain a substring of specific characters.
So, in the Rule, we already had something like
IF : String.stringContains(user.dn,"DC=example") : THEN : Assign to Example Group for Provisioning
But they added "duplicate" users that I need to EXCLUDE from ServiceNow, and therefore, I am trying to do something like
IF : (String.stringContains(user.dn,"DC=example") AND String.[some function for 'does not contain'](user.login,"-abc@")) THEN : Assign to Example Group for Provisionining
Any help would be appreciated. Thank you.

Hi Aaron,
I would suggest you to read our Okta documentation for OEL expression in regarding to how to utilize OEL expression and list of all supported operators when create group rule.
For your question in specific, you will use the same String.stringContains() function but in the case where you want to specify NOT Contains condition, you will need to include '!' or 'NOT' operator as well.
For example,
(a) String.stringContains(user.login,"admin") AND !String.stringContains(user.login,"@test.com")
---OR---
(b) String.stringContains(user.login,"admin") AND NOT String.stringContains(user.login,"@test.com")
Either one of above OEL expression evaluation will result into below:
(a) user.login = admin@mydomain.com - Match
(b) user.login = admin@test.com - Does not match
I hope this helps answers your question. But if you have additional questions, please open a customer support ticket with Okta Technical Support Team.
Regards,
Seng-Ei Liaw