- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 07:47 AM
HI All,
I have a cancel button that I want to show only when a user has role 'Change_coordinator' and the state of change is not one of 14, 12, or 3
So My UI condition is:
gs.hasRole("change_coordinator") && current.state NOT IN '14','12','3')
ServiceNow doesnt like it, it reports the following error:
Do you know how I can get condition to show: 'is one of' or 'is not one of'?
Thanks in advance for your help!
Solved! Go to Solution.
- Labels:
-
Best Practices

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 07:55 AM
Hi, This is not possible but you can do same (IN) with "gs.hasRole('change_coordinator' && (current.state == '14' || current.state == '12' || current.state == '3')". And NOT IN with "gs.hasRole('change_coordinator' && current.state == '14' && current.state == '12' && current.state == '3'".
Thanks, Tanaji Patil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 07:52 AM
You need to apply the condition like,
- gs.hasRole("change_coordinator") && (current.state!='14' || current.state!='12' || current.state!='3' )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 07:58 AM
Thanks Balaji,
So I thought, but that did not work. when the state is actually '3' the cancel button still shows up.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 08:00 AM
You have to && states and not ||.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2017 08:04 AM
yes provide && operator,
- gs.hasRole("change_coordinator") && (current.state!='14'&¤t.state!='12'&¤t.state!='3')