How to make groups visible based on other fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
I have two fields Test1 &TEST2 both are yes/no type.If both are no then groups of type ITSM should appear in catalog item in service portal l.How to achieve this and group is select box type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
you can make it work with just two onChange catalog client scripts, one for each Yes/No field.
Each script checks both Test1 and Test2 values , if both are “Yes,” it sets the group field to ITSM,
Depending on your use case, you might also want to run it onLoad to handle pre filled values.
example for field test1
if (newValue === 'Yes' && g_form.getValue('test2') === 'Yes')
g_form.setValue('group', 'ITSM');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Create onChange Catalog client script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) return;
var test1 = g_form.getValue('test1'); // 'true' or 'false'
var test2 = g_form.getValue('test2');
var showGroup = (test1 === 'false' && test2 === 'false');
g_form.setDisplay('group', showGroup);
if (!showGroup) {
g_form.clearValue('group');
}
}
Thanks,
Vignesh
"If this solution resolves your issue, kindly mark it as correct."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
22m ago
so what did you start with and where are you stuck?
you didn't share any scripts and screenshots etc
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader