Hide Process flow states dynamically just like complete and deferred state.

Neeraj_27
Tera Guru

Hi Community,

I have to hide/show Rejected and Incomplete dynamically in process-flow formatter of demand table just like deferred and complete in process flow formatter shows and hides.

I have tried by UI policies by using DOM manipulation it works. But DOM manipulation is not best practice is there any other feasible way?

 

Thanks in advance for the response.

3 REPLIES 3

jaheerhattiwale
Mega Sage
Mega Sage

@Neeraj_27 Go to "System UI > Process Flow" module

Open your process flow record and update the correct condition in condition field

jaheerhattiwale_0-1672987259025.png

 

 

The condition which your are trying to add on UI policy can be added here.

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

Hi @jaheerhattiwale ,

I made earlier itself "Rejected" and "Incomplete" states visible on the table using the process flow module. Condition works as at what state "process flow formatter-state" needs to be highlighted. 

But the thing is, I have a requirement where I need to show the Rejected state on the process flow formatter only when the state is in rejected same as how OOB "deferred" state works it will be visible only when the state is in deferred/Rejected/Incomplete.

Thanks Btw.

 

Hilel
Tera Contributor

Hi,

I did an onLoad client script that hides the elements of the "full_elements" variable depending on the value of the "u_lifecycle_flow" field,

it is DOM manipulation so not best practice but it is the only way I found to have a dynamic process flow depending on a field value, you can change the code to fit your need (you will most probably need to change the querySelectorAll on line 6)

Hilel_0-1717743899153.png

 

ps: do not forget to set the client script field "isolate_script" as false (not on the form for me) or it won't work