Hide UI Action on the basis of certain conditons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 04:03 AM
I want to hide UI action on the basis of certain condition. I have written script include and I am calling that script include in UI action condition. It is not going in script include, I am not getting logs as well. Can anyone please help as it is not working as expected.
Script include :

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 04:37 AM
Have you verified the state are correct? I just tested with one state on Incident, works immediately.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 04:38 AM
Or did you perhaps miss any fields on UI Action, for example didn't select Form Button? Can you share a screenshot?
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 04:46 AM
Now it is printing the logs but it is printing the logs which are only before while loop. state and everything which I have given is correct only.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 04:48 AM
inputOla.addQuery('number', current.sys_id);
Number doesn't sound like a reference field? Though you are entering a sys_id to query. Can you verify that this is correct or that this is your mistake?
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 04:50 AM
yes number is not a reference field