- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2025 03:19 AM
Hi All,
I have a requirement where a catalog variable job_number should:
Not be visible on Catalog Item or RITM (achieved by a Catalog UI Policy).
Be mandatory only on SC Tasks when:
Short description starts with "Create address book record"
Assignment group is ABC Group
What I tried:
Created a UI Policy on sc_task table with the below condition but no policy actions are given since its a catalog item variable.
Script used:
function onCondition() { g_form.setMandatory('job_number', true); g_form.setVisible('job_number', true); }But this UI Policy is not working for my variable.
In our instance, I have seen other similar configurations working fine, but not for this one.
Can anyone help me understand why my SC Task UI Policy is not working for this catalog variable? Do I need to make additional settings for the variable to be recognized on SC Task?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2025 03:54 AM - edited 08-22-2025 03:55 AM
Hi @Mahalakshmi Rav
the problem is you used a normal UI Policy on sc_task. Normal UI Policies can only control table fields. Catalog variables live in the Variable Editor, so they’re controlled by Catalog UI Policies / Catalog Client Scripts (with “Applies on Catalog Tasks” enabled), not by standard UI Policies.
Catalog Client Script (onLoad)
-
Create a Catalog Client Script tied to the Catalog Item.
-
Check Applies on Catalog Tasks.
-
onLoad script:
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2025 06:04 AM
Hi @Ankur Bawiskar , I tried but it's the same, I don't see the job number in the sc_task form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2025 06:11 AM
syntax is correct.
Any other UI policy is conflicting?
Make UI Type - ALL
Did you try adding alert in UI policy script and see if condition is getting satisfied?
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
08-26-2025 02:14 AM
I believe I also shared a working solution.
As per new community feature you can mark multiple responses as correct.
If my response helped please mark it correct as well so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader