show/hide section based on assignment group name

archie5
Tera Expert

I want to make a section visible on the form based on assgn group name. Let's say I have 2 groups A and B, and two sections with same name A and B
Section A should be visible only when group A is selected, B section only when Group B is selected and so on
Section name will be same as group name. How to not hard code this so that this works even when more groups and sections (of same names) are added. Thank you!

13 REPLIES 13

niharika19
Mega Guru
Mega Guru

@archie5 You can store the mapping of the section to Assignment group in a system property .And call the property in the script .

When new section to group mappings aligned in future just onboard the mapping to the property created above 

Which script should I use OnChange client script? Or should it be an ajax first? Can you help me get started?

Ankur Bawiskar
Tera Patron
Tera Patron

@archie5 

should be an easy task.

what script did you use so far and what's not working?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

I have used OnChange Client Script (make section visible on change of assignment group). But I have hard coded it. Looking for guidance to make it dynamic.