Unable to set a Name-Value type field to hidden using a UI Policy or a Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I created a Name-Value type field so that IT can write down the assets that need to be purchased and the quantity, however it only needs to be visible on specific tasks.
So I made a ui policy that states it only should be visible on tasks which short description contains "Initial Equipment Request" However this is not working and is showing on ever sctask record. Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Buddy,
What you’re seeing is expected behavior for a UI Policy.
Right now, your UI Policy only tells ServiceNow when to make the field visible, but it never tells it what to do when the condition is not met. As a result, the Name-Value field stays visible on every sc_task.
The simplest fix is this:
Open the UI Policy
Check “Reverse if false”
In the UI Policy Action, set the field to Visible = true
This makes the logic work like people usually expect:
If Short description contains “Initial Equipment Request” → show the field
If it doesn’t → hide the field
Also double-check that:
The UI Policy is on Catalog Task (sc_task), not the base Task table
The condition is using sc_task.short_description
Once you enable Reverse if false, the field should only appear on the intended tasks and disappear everywhere else.
@solanovale - Please mark Accepted Solution and Thumbs Up if you find Helpful 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @solanovale ,
I created a name-value pair field as "editor" and then applied UI policy condition as , if short description contain "caller" then it should visible ->true, otherwise it should be hidden. everything is working as you mentioned.
you can also refer below images
💡💡IF this is any helpful , then give a thumbs up👍 and accept the solution ✔️.
