how to hide a button from specific view

Mehar Naaz
Tera Contributor

MeharNaaz_0-1697693795974.png

I want to hide 'View Locations' button  from a specific viewbut it should be visible in Default view. Can anyone help me to achieve this?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Mehar Naaz 

you can hide it based on UI Action Visibility related list

You can specify the views in which it should be visible by creating a record into that related list table

Create a UI action 

 

AnkurBawiskar_0-1697694260824.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Mehar Naaz 

you can hide it based on UI Action Visibility related list

You can specify the views in which it should be visible by creating a record into that related list table

Create a UI action 

 

AnkurBawiskar_0-1697694260824.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

RaghavSh
Kilo Patron

Open the "View Locations" in UI actions and try below in condition field:

 

var map = gs.action.getGlideURI().getMap();map.get('sysparm_view')=='default';


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn

Harsh_Deep
Giga Sage
Giga Sage

Hello @Mehar Naaz ,

 

Create a new record in the "sys_ui_action_view" table.

 

Screenshot 2023-10-19 112836.png

UI Action Visibility = add your UI Action name

View = Select view for which you don't want to show that UI Action

Visibility = Exclude
Screenshot 2023-10-19 113056.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Harsh

@Harsh_Deep 

This is same as what I shared as 1st response i.e. to use UI Action Visibility.

Any reason to share the same details again? It might confuse the person.

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