- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2025 06:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2025 08:00 AM
you can use onLoad client script for this something like this
function onLoad() {
// Show contact_type field based on assignment_group value
var group = g_form.getValue('assignment_group');
g_form.setVisible('contact_type', group != '');
}
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-01-2025 06:26 AM
You can accomplish this through a UI policy. Something similar to this: set up your filter like this:
Then create a UI action and set it up like this:
Hope that helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2025 06:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2025 06:31 AM - edited ‎05-01-2025 06:45 AM
Hi @jai281997
You can use UI policy to hide the form fields.PFB.
If you still want to use client script, then use below client script (on load/on change)
function onLoad() {
//Type appropriate comment here, and begin script below
var group = g_form.getValue('assignment_group');
if (group == '') {
g_form.setVisible('contact_type', false);
} else {
g_form.setVisible('contact_type', true);
}
}
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-01-2025 08:00 AM
you can use onLoad client script for this something like this
function onLoad() {
// Show contact_type field based on assignment_group value
var group = g_form.getValue('assignment_group');
g_form.setVisible('contact_type', group != '');
}
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