
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 10:07 PM
Hi all,
For one of my Instance Scan use cases, I am thinking of creating a UI Action which should only be visible for tables which contain at least one script type field. Ideally ofcourse using the condition field within the UI Action for this.
Ofcourse I could create a UI Action specifically for every single table with a script type field, though then I would need to create hundreds of UI Actions, and what if new tables are added... Instead wanting to run this against sys_metadata, which works fine for my use case. Though now the question, also limiting this to only the tables with an actual script field.
Any ideas?
I haven't done much brainstorming myself yet, though thought let's post on the community, perhaps someone already has did some serious thinking on this 😅
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Ah yeah, I solved it by using g_scratchpad. A business rule populating the value, and just using it in the UI Action. It was just for brainstorming / playing around, so not actual production work. For example haven't looked into if this would hurt performance.
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
02-07-2024 10:29 PM
Hi Mark,
i dont know if it also Works for Scoped apps.
but this is written in theDocs: Select Global to make the action available on all tables.
Create a UI action (servicenow.com)
An i guess then you can check if a Field Type like this is Part of the Current Table?
Condition <- Script Include
BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 02:30 AM
I have exactly the same issue, just for another scenario. I'm working in a scoped application, and the Table field does not allow me to use sys_metadata (nor Global, nor anything below sys_metadata like the UI Action table itself). I don't really want to create another application in Global scope just to get it running. Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 05:15 AM
Update: As it is fine for my scenario (at least for this stage where it's rather a technology demonstration), I decided to go with a Global scoped app which I call "extension" to the actual app. With that approach, I was able to create the UI Actions for sys_metadata.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 02:42 AM
Apart from my own challenge to add such a UI Action in a scoped application - what if you implement a little workaround for now, and create a Sys Property with a list of all the tables where you want the UI Action to appear?
Then you could still create it on sys_metadata, and restrict the access using getProperty() with a check if current.getTableName() is included there or not.
Maybe not the most elegant option, but it should work.