Unable to set a Name-Value type field to hidden using a UI Policy or a Client Script

solanovale
Tera Contributor

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. 

solanovale_4-1768942578056.png

 

 

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?

solanovale_0-1768942406375.png

 

solanovale_2-1768942514860.png

 

 

 

 

2 REPLIES 2

Matthew_13
Mega Sage

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 🙂

MJG

Abhishek_W
Mega Guru

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

Screenshot 2026-01-21 103206.pngScreenshot 2026-01-21 103218.png

 

💡💡IF this is any helpful , then give a thumbs up👍 and accept the solution ✔️.