How to hide a process flow formatter until it reaches a particular state?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2021 03:15 AM
So basically I have to hide the process flow formatter showing various states for a table until it reaches to a particular state.
For example consider this image:
Let assume the formatter will be hidden till it reaches Fix in Progress.
Is there anyway that this can be acheived?
- Labels:
-
Script Debugger
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-22-2021 05:35 AM
Hi,
It worked fine for me
See below
Client Script:
Output:
a) It removed the process flow as the state is not Fix in Progress
b) It kept process flow as the State is Fix in Progress
Regards
Ankur
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-12-2021 02:31 AM
Hope you are doing good.
Did my reply answer your question?
If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
Thanks!
Ankur
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-14-2021 11:32 PM
Hope you are doing good.
Did my reply answer your question?
If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2021 11:04 AM
Hello Ankur,
I had a similar requirement for which your solution helped. However, there was one limitation for me
My requirement was to hide the flow formatter if it is a new record, for which I created a view, and hide the flow formatter by using DOM manipulation based on the view.
When I did that, the reference fields on the form were not loading the lookup list. No action when I clicked on the magnifying glass icon on the reference field.
Is there any other way to hide the flow formatter other than using DOM Manipulation
Thank you in advance
Regards,
Parthiban

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2022 12:22 PM - edited ‎11-16-2022 12:24 PM
This worked for me to remove the Review item from the formatter when not in Review, from the change_request table, t:
onLoad Client Script:
...
if(g_form.getValue('state') != 0){
$j("a:contains('Review')").parent("li").hide();
}
...
TL;DR
This looks in the document for anchor tags, <a>, and further looks to see if it contains the keywords I want, in this case 'Review'. Then it finds the parent <li> tag and hides it, along with the anchor within it.