How to make UI Action invisible from UI policy or Client script based on condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 09:54 PM
Hello friends,
There is an OOTB UI Action which I do not want to customize.
My requirement is that the UI Action is visible based on some condition / inputs on the page.
Can I achieve it through UI policy or client script ?
Please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 04:37 AM
Hi @Asmita7
You can simply use insert and stay button to make a copy of that UI Action and add your conditions there. You can inactive the OOTB UI Action after that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 10:04 PM
Hello @Asmita7,
I am sure not that we can hide the UI action using any client script or UI Policy. We can hide it only using through the conditions on the UI action itself.
If the above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.
Thank You!
Prathamesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 10:42 PM
Yes. But the problem is client is not agreed to change any OOTB UI action condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2023 10:10 PM
you can show/hide it using client script but it requires DOM manipulation which is not recommended.
I won't recommend that
If you still require check this link and enhance the logic
Unable to show/hide UI action located at the bottom of the form through a UI policy.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2023 05:07 AM
please check the link I shared above.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader