How to Hide UI action button on list view based on the State field

SivaprasadV
Tera Expert

In servicenow I have created a table.  In the table I created a button which will display on list Banner. I want to show that if in the list view record are in draft state. if any record's state is other than draft, that I should Hide the button from the list is it feasible in Servicenow..?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@SivaprasadV 

List Banner buttons work on list and you can add condition in that.

You can't hide the button from list

The below is OOTB behavior

Example: current.state == 3

Now if you select 10 records from list and out of those only 6 are having State=3 then the script within List Banner will run only for those 6 and not for remaining 4

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

4 REPLIES 4

Tanushree Maiti
Kilo Patron

Hi @SivaprasadV 

 

Check this post, try it with your state value and requirement

 

https://www.servicenow.com/community/service-management-forum/show-hide-of-list-banner-buttons-based...

 

https://www.servicenow.com/community/developer-forum/how-to-show-and-hide-list-banner-button-on-part...

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Ankur Bawiskar
Tera Patron

@SivaprasadV 

List Banner buttons work on list and you can add condition in that.

You can't hide the button from list

The below is OOTB behavior

Example: current.state == 3

Now if you select 10 records from list and out of those only 6 are having State=3 then the script within List Banner will run only for those 6 and not for remaining 4

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Hi @Ankur Bawiskar ,

 

Thanks for the solution I've implemented initially the second option which you suggested. But thanks for the solution.

AndersBGS
Tera Patron

Hi @SivaprasadV ,

 

Just put a condition on the UI action based on the record state.

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/