How to hide process flow stages based on condition in scoped application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 04:07 AM
Hello,
I have enabled the process flow for my custom application scope. Created the onLoad client script and in script I wrote
function onLoad() {
//Type appropriate comment here, and begin script below
if (g_form.getValue("type") == "query") {
$j("a:contains('Accepted')").parent().hide();
}
}
based on type I have to hide some of the stages of the process flow. This script is working in global scope like on incident form. Can anyone suggest me another approach to enable this for scoped table, that would be appreciated.
Thank you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 11:22 PM
Hi @SairajG ,
Are you getting any errors in your browser console?
Maybe this topic can help you forward, it doesn't rely on jQuery to hide the steps:
Best regards,
Joni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 11:34 PM
you are using DOM manipulation in your script which is not recommended.
Ensure Isolate Script field is False for this client script.
This field is not on form but from list you can set it as False
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-12-2025 02:18 PM
As a note, have you looked into configurable workspace? They provide a much more modern user experience and more flexibility.