choices hide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 11:27 AM
i have variable name "role" select box type : primary below three options 1 Administrator 2 Standard User 3 User Administrator if user select "Administrator" i want to show : Security Group - General Security Group - Employment Security Group - General Counsel remaining need to be hide if user select "Standard User" i want to show : Security Group - General Security Group - Employment Security Group - General Counsel remaining all need to be hide if user select " User Administrator " i want to show : Security Group - Ascent User Administrator remaining all need to hide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 07:14 AM
Hi @kotab
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0784512
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 07:36 AM - edited 04-25-2025 07:36 AM
Hi @kotab ,
This can be done via Choice [ sys_chocie ] where role values are dependent value for security group.
Create 3 record for roles and 7 record for security group in Chocie table [sys_choice ] with dependent role value, this will a simple implementation and easy to maintain for addition/updatation. You can use these record via lookup select box type variable. [ here you dont need to write onChange client script ]
Otherway, you can write onChange client script on role and apply condition on role value ( using If or switch/case ] add the security group at run time, every time onChange trigger, first clear the security select box then add values.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 07:37 AM
Is this on a Catalog Item? If so, you can restrict the visible aspect of these choices using a Catalog UI Policy. If it is on a form view, you can use dependent fields.