How to call a script include in the Relationship table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 01:15 AM
I have created a Script Include and want to call it in the below query, what is the best way to code this? I am creating a new relationship to display in a related list, similar to this: How to create Scripted Relationships or Defined Re... - ServiceNow Community
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 04:37 AM
I have a script include which pulls the process owner approval details from the related outage record and is also called as part of the approval flow process. Next steps for me are to define the relationship on the sys_relationship table and add a new related list on the change form that will display the Process Owners approval only. I have defined the relationship between the change table & the sysapproval table but the code i've tried so far seem to work. I know I need to call the script include but confused on how to get it to actually display the PO approval details.
Extract of the script include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 04:54 AM
your understanding is correct.
the script include should return sysIds from sysapproval_approver 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
02-19-2025 05:58 AM
I have used this script but it has not worked unfortunately:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2025 07:11 PM
try this
1) you are not passing the CHG sysId to that function then how will it fetch the record
2) also ensure sysIds returned are for sysapproval_approver table records
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
04-30-2025 07:25 AM
Hope you are doing good.
Did my reply answer your question?
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