How to hide a process flow formatter until it reaches a particular state?

Arsh1
Tera Contributor

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:

find_real_file.png

Let assume the formatter will be hidden till it reaches Fix in Progress.

Is there anyway that this can be acheived?

9 REPLIES 9

Hi,

It worked fine for me

See below

Client Script:

find_real_file.png

Output:

a) It removed the process flow as the state is not Fix in Progress

find_real_file.png

b) It kept process flow as the State is Fix in Progress

find_real_file.png

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

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.

find_real_file.png

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

J Trunnelle
Tera Expert

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.