UI Action visibility based on form changes without DOM manipulation?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 02:37 AM - edited 05-08-2025 02:38 AM
Hi all,
Does anyone know how to hide a UI Action based on form values without doing any DOM manipulation stuff? The UI Action Conditions alone don't help, as they are not evaluated on form changes.
I've got a concrete example: In the Catalog Task, there is the OOB "Close Task" button which is really not helpful if you want to close the task as "Closed Incomplete". When you click it after changing the field value, it immediately closes the task as "Closed Complete". So I can either change the code of the UI Action to keep the state in such a case, or I find a way to hide the button if the user changes the state to "Closed Incomplete". on the form.
So if I want to try the second option, can I do it without touching the DOM (something that Instance Scan would definitely complain about for good reasons)?
Best regards
(PS: Not sure why this post ended up in this forum, but I hope it can get answered anyway)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 02:40 AM
you will have to use DOM manipulation with 2nd option. no other way
Another way is to have your own custom UI action to mark task as "Closed Incomplete" and let user chose which button they want to click.
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
05-08-2025 10:53 PM
Hope you are doing good.
Did my reply answer your question?
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
05-09-2025 08:13 AM
Creating an alternate UI Action would be a better approach instead of trying to use the same UI Action to Close Cancel/incomplete