How to hide process flow stages based on specific field conditions on the table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2020 04:36 AM
Hello All,
I have a process flow formatter as below,
I have a true/false checkbox field on the form based on this field I have to hide/show two more stages on to this table formatter in between the existing stages, is it possible?
Thanks in advance for the response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2021 04:24 PM
Thanks for the modification Ankur, got this working based on your script.
However $$ wasn't working for me so I had to change it to
$j("a:contains('Initial/Draft')").hide();
After setting the ui policy to non isolate.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2022 03:12 AM
I tried the same way as above but its not working at all !!
want to hide 3 of the process flow formatter based on status values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 11:59 PM
Hi Shantharo,
Let me know if that answered your question.
If so, Please consider marking appropriate reply as ✅Correct & 👍Helpful.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2024 03:09 AM
I tried the solution like:
function onCondition() {
$$('.disabled')[4].hide();
$$('.disabled')[5].hide();
}issue is that as you move through phases the index of the phases changes based on current active phase. example in change management:
on phase New => Assess is index1, Authorize is index2, Scheduled is index3...
on phase Assess => Assess is active, Authorize is index1, Scheduled is index2...
on phase Authorize => Assess is index1, Authorize is active, Scheduled is index2...
and so on.
My customer decided to use new type of change and I had to get rid of some default phases, so I created UI Policy with isolate script false and condition: if type is my new change type then run this script in execute if true:
function onCondition() {
var phasesToHide = ["Assess", "Authorize", "Scheduled", "Implement", "Review"];
var disabledElements = document.querySelectorAll('.disabled');
disabledElements.forEach(function(element) {
phasesToHide.forEach(function(phase) {
if (element.textContent.includes(phase)) {
element.style.display = 'none';
}
});
});
}
}and this worked. I also created similar script, with condition if type is standard, normal or emergency then ignore phases from my new change type. i know this could be done in execute if false but I'm not sure how many other change types customer will think of.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 01:51 PM
$j("a:contains('Review')").parent().hide();
