Hide and show process flow based on the category.

SRI10
Tera Contributor

Hi,

In Business management, Draft -> Submitted -> Screening -> Qualified -> Approved -> Completed.is available out of the box. I have added new custom field "Demand Category". I want to hide the state- Screening in process flow if the Demand Category is "Client". 

How can I do this?

1 ACCEPTED SOLUTION

Hi,

it is a jquery code which would search for that text which would be present inside anchor tag

Regards
Ankur

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

View solution in original post

14 REPLIES 14

Hi Sri,

Whenever you give the condition it highlights the Stage but doesn't remove it from the form.

If you want to remove it from form then you would require DOM manipulation and it is not recommended

If you still require that then please use this

1) create onLoad client script on your dmn_demand table

2) Ensure Isolate Script field is set to false for this client script

  • By default when you save client script it is true
  • This is not present on form but from list you can make it to false once you save client script

Script below:

Note: Ensure you give proper field name and drop down value for demand category and client delivery

function onLoad(){

if(g_form.getValue('demand_category') == 'Client Delivery'){

$j("a:contains('Screening')").hide();

}

}

find_real_file.png

Regards
Ankur

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

Hi Ankur,

Thank you. It is working...Can you please tell me how this line of code is working...?

$j("a:contains('Screening')").hide();

Hi,

it is a jquery code which would search for that text which would be present inside anchor tag

Regards
Ankur

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

Hello @Ankur Bawiskar 

Sorry to jump in here, this was very helpful as I was looking for a similar implementation.

But in CSM Case form, the process flow formatter OOTB shows this whenever a state changes to Awaiting info.

find_real_file.png

But for all other states, it shows normal formatter like this,

find_real_file.png

I'm not sure where is the configuration to hide the states in Process flow formatter provided. But I think there's another way to do it without DOM manipulation. Can you help to find that ??

Thanks.

Hi Hardik,

Can you please check the Process flow formatter configured for CSM?

last time when I checked on similar question it didn't hide so DOM approach was used.

Regards
Ankur

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