"Add" UI action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello all,
I am trying to create an "add" ui action for a related list. When "add" is selected, it needs to open a list view of a custom table I created, in a separate tab. From there, the user needs to be able to select multiple records, select "add" or "save", the tab close automatically, and those records be populated in the related list. Any help?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
you can check how OOTB "Add" button is created for related list.
On similar lines add for your table
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
-
UI Action on related list → open a modal / new tab with your custom table list.
function openAddRecordsDialog() { var url = 'your_ui_page.do?sysparm_parent=' + g_form.getUniqueValue(); window.open(url, '_blank'); // or use GlideModal } -
Custom UI Page/UI Builder → show records with checkboxes + Save button.
-
On Save → send selected sys_ids via GlideAjax/REST to a Script Include that inserts rows in the junction/child table:
gr.initialize(); gr.parent = parentId; gr.child = childId; gr.insert();
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/