Form - New Context Menu section with UI Actions items inside
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 08:06 AM
Hello,
I am working on modifying the form Context menu to include three UI actions inside a new Section. The goal is to develop a feature akin to the "Configure" section within the Context Form menu.
New Section Menu -> UI Action 1, UI Action 2, etc
I have been struggling to find information and make progress on this project.
Has anyone implemented this before? Any insights on how to make it work?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 08:21 AM
Hi @epinetti ,
if you are trying to add a ui action
that would be showing up above the configure section
to add to form context menu check the form context menu checkbox in the ui action record
if you are trying to add something in the configure section
that's not possible with out Dom manipulation
create a on load client script and use the dom manupulation
those not UI actions
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 08:30 AM
Hi @epinetti,
Create 3 actions:
Example: “UI Action 1”, “UI Action 2”, “UI Action 3”
Check Form context menu as true
Group them under a custom section (like “My Tools”)
ServiceNow doesn’t directly support custom menu sections, but here’s a trick:
You can use an on load client script on the same table to add a fake section header and place your UI Actions below it.
addLoadEvent(function() {
if (typeof gForm != 'undefined') {
// Add a visual section label (non-clickable)
gForm.addContextMenuOption('', '-- 🔧 My Custom Tools --', '', '', '', true);
// Add your UI actions under it
gForm.addContextMenuOption('', 'UI Action 1', 'my_ui_action_1');
gForm.addContextMenuOption('', 'UI Action 2', 'my_ui_action_2');
gForm.addContextMenuOption('', 'UI Action 3', 'my_ui_action_3');
}
});
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 10:03 AM
hi @pavani_paluri
thanks for this trick.. could you please elaborate a lil bit more how I should process with the step
"Group them under a custom section (like “My Tools”)" ??
Not sure from where I could do that... from the UI Action form definition is not possible to do it
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2025 10:55 AM
Hi @epinetti,
You can group them by creating a fake section using on load client script:
You can use an on load client script on the same table to add a fake section header and place your UI Actions below it.
addLoadEvent(function() {
if (typeof gForm != 'undefined') {
// Add a visual section label (non-clickable)
gForm.addContextMenuOption('', '--
My Custom Tools --', '', '', '', true);
// Add your UI actions under it
gForm.addContextMenuOption('', 'UI Action 1', 'my_ui_action_1');
gForm.addContextMenuOption('', 'UI Action 2', 'my_ui_action_2');
gForm.addContextMenuOption('', 'UI Action 3', 'my_ui_action_3');
}
})
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P