choices hide

kotab
Tera Contributor
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 



 

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @kotab 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0784512

https://www.servicenow.com/community/itsm-forum/catalog-item-to-show-subcategory-based-on-dependant-...

https://www.servicenow.com/community/incident-management-forum/show-sub-categories-based-on-category...

 

*************************************************************************************************************
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]

****************************************************************************************************************

AshishKM
Kilo Patron
Kilo Patron

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

BrianProvencher
Giga Guru

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.