IF statement to do a NOT LIKE comparison

clyon
Tera Guru

In a business rule, I need to check if the users email does not contain a particular string like

                  gr.user.email !* NOTLIKE 'abc.com'

I have tried a few variations using the !* and NOTLIKE but there is still an issue with it.

Suggestions!   TIA

1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

Hi Christina,



Please use


if (gr.user.email.indexOf('abc.com')==-1)



Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

4 REPLIES 4

SanjivMeher
Kilo Patron
Kilo Patron

Hi Christina,



Please use


if (gr.user.email.indexOf('abc.com')==-1)



Please mark this response as correct or helpful if it assisted you with your question.

Perfect. Thank you!



What would be the inverse of that if I want check if it CONTAINS?


I tried gr.user.email.indexOf(abc.com')==1 and that didn't work.



Thanks


to check contains use gr.user.email.indexOf(abc.com')>-1



Please mark this response as correct or helpful if it assisted you with your question.

Chinthuja2
Giga Contributor

Hello,


Can you try to use 'DOES NOT CONTAIN' in the query?


something like,   gr.addQuery('user.email','DOES NOT CONTAIN','abc.com');