Adding a UI Action link as field type (for both li... - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Hi there,

 

Adding a UI Action link as field value, in a list layout, or on a form layout, man that would be nice! Though wait, you might have seen such before, for example when working with Update Sets and Previewing Problems. The "Available Actions" field shows even multiple links. So what is that? How does it work? Can you actually achieve such yourself?

 

It's absolutely not new and already exists for years, though hardly documented:

 

UI Actions List


Example: Link

Two out-of-the-box examples, one which already exists for years, one which exists since the introduction of Instance Scan (Quebec):

 

Update Set Preview Problems

find_real_file.png

Scan Results

find_real_file.png


Field type: UI Actions List

So what is this? How does it work? It concerns Field type "UI Action List". A field type that you won't come across that quickly, basically because it's not used that much out-of-the-box (only 14 fields of this type on a clean instance) and because the UI Action List field type is hidden. The Field class record [sys_glide_object] has Visible set as false. When setting Visible to true you would see the UI Actions List field type when working with new fields.

 

find_real_file.png

 

Why this field type is hidden? No clue. Like I mentioned, UI Actions List is hardly documented. It's not like it's a legacy field type, it's even used for a newly introduced field in the Quebec release.

 

When you would change Visible to true on the Field class record, UI Action List is available to select as field type:

 

find_real_file.png

 

Looking into how this field works, why one or more links are shown: when opening a record that contains a field of type UI Actions List, you'll notice that that field actually contains one or more (comma separated) sys_ids. Sys_ids?! Sys_ids from… UI Actions! Just like the name of the field type actually. So the trick is to have the field automatically filled with the sys_ids of one or more UI Actions.


UI Action

Key need to knows about the UI Action that you could use in the UI Actions List field:

 

1. "Name" is what you would see as a link
2. Set "Client" to true
3. Set "Form link" to true
4. "Script" anything you'd like! It could be just opening a certain URL or even executing certain script logic. You don't have to limit yourself to just a "link".

---


And that's it actually. Hope you like it. If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

ServiceNow Technical Platform Architect @ Quint Technology

2x ServiceNow Developer MVP

2x ServiceNow Community MVP

---

LinkedIn

Comments
Community Alums
Not applicable

is there a way to not show the Field name?

Akshat0108
Tera Explorer

but it is read only

Mark Roethof
Tera Patron
Tera Patron

What is read only?

Version history
Last update:
‎08-14-2024 11:07 AM
Updated by:
Contributors