Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to hide UI action button based on condition

vidhya_mouli
Tera Sage

I have a UI button Ready for delivery. This button should be visible only when the stage is in_progress. When user clicks on this button, it should update the stage to ready_for_delivery and hide this button. How do I do this?

 

I am updating the stage through a flow.

 

vidhya_mouli_0-1715347637969.png

 

 

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @vidhya_mouli ,

I tried your problem in my PDI and it works for me. In your UI Action add below condition 

current.state == 'ready_for_delivery' (In string)

 

SarthakKashyap_0-1715427877109.png

Note: If you are using current.state you need to be client to false so that's why it works 

 

Result 

SarthakKashyap_1-1715427957222.png

 

SarthakKashyap_2-1715427995349.png

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

View solution in original post

8 REPLIES 8

SK Chand Basha
Tera Sage
Tera Sage

Hi @vidhya_mouli 

 

In the condition field, add a script according to the condition.

 

And also you can refer this it might be helpful

 

https://www.servicenow.com/community/developer-forum/how-to-hide-ui-action-based-on-field-change-in-...

 

Mark it Helpful and Accept Solution!! If this helps you to understand .

 

Thank you for your reply. I tried this but did not work.

vidhya_mouli_0-1715348326283.png

 

Gangadhar Ravi
Giga Sage

what do you have on condition field on this UI action?

Current.stage == in_progress