Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Declarative actions

Vedavalli
Kilo Sage

Hi Can we configure the visibility of the declarative actions?

my requirement is when the status changes to in progress declarative action button should show and then clicking on the on hold declarative action button it should update the record status to on hold and button should not be visible is this possible via server type script in declarative actions.

in script condition i mention current.state.changesTo('9')but not working

4 REPLIES 4

Rafael Batistot
Kilo Patron

Hi @Vedavalli 

 

These links might help you 

 

https://www.servicenow.com/community/developer-blog/declarative-actions-in-servicenow-the-complete-g...

 

https://www.servicenow.com/community/developer-forum/how-to-hide-a-declarative-action-for-a-specific...

 

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.

RaghavSh
Mega Patron

I believe the condition should be current.state==9 because after clicking the button, the form will load.

Make sure backend value of in progress state is  9.


Raghav
MVP 2023
LinkedIn

@Vedavalli Did this work for you


Raghav
MVP 2023
LinkedIn

Ravi Gaurav
Giga Sage
Giga Sage

Hi @Vedavalli 

Instead, use a condition like current.state == 9 for the visibility, and then let the Declarative Action update the state to On Hold. Once updated, the button will hide automatically because the condition is no longer met.

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

ï”— YouTube: https://www.youtube.com/@learnservicenowwithravi
ï”— LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/