How to make a UI action disappear after it was clicked and have another UI action appear?

Linda6
Mega Guru

Hi!

I have the change task form and there is a UI action 'Request four eyes check'. When the change task is in phase 'Implementation', the UI action 'Request four eyes check' is visible. When I click on it, the 'Phase' value changes to 'Deployment', the 'Request four eyes check' UI action should disappear and another UI action called 'Deploy change' shall appear.

I have checked quite a plenty of articles here, but really didn't find anything relevant or what would seem a best practice...

I am having trouble finding out how to make one UI action disappear and another one appear. What is the best practice here, please?

This is the form:

find_real_file.png

This is the UI action I have made so far:

find_real_file.png

Thank you very much in advance

 

 

1 ACCEPTED SOLUTION

palanikumar
Mega Sage

Add the below condition to the existing condition. This will make sure the UI Action visible only for 'implementation' phase.

&& current.u_phase == 'implementation'

 

For Deploy Change UI Action you can add the below condition

&& current.u_phase == 'deployment'

Thank you,
Palani

View solution in original post

6 REPLIES 6

Hello Allen,

It was me who put in there those conditions 🙂 I just had no idea I can also control the visibility of the UI action within those conditions...honestly thought maybe there is a need to build a UI policy or some client script that will hide/show the UI action :)))

Still at the beginning of my ServiceNow journey, learning something new every day...thanks to all MVPs and everyone helping us newjoiners, your help is very appreciated..

Hi,

Understood. Yeah, the conditions are ONLY for the visibility of that UI Action, that's that field's purpose:

find_real_file.png

Here's the UI Action documentation as well, just to assist: https://docs.servicenow.com/bundle/rome-platform-administration/page/administer/list-administration/...

This is why I like to discuss things beyond just handing out the code to people. Now we've learned this: you're new to ServiceNow and what you thought about the condition field. So this helps 🙂

Hope you're enjoying Accenture as well. Lots of great resources and individuals there.

Please mark reply as Helpful, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!