Preset Checkbox on Catalog item

Brian Sorensen
Giga Guru

I have a New hire guide with a series of checkboxes.  HR has asked if we can predefine some to true depending on the Employee type

 

Here is what I have

Employee Type (variable -  employee_type)

BrianSorensen_0-1702052311264.png

Then below I have a series of checkboxes that will show the correct catalog item

BrianSorensen_1-1702052434707.png

 

 

When the user checks each box, hits next and we only show those options

What HR wants to do is

If the Employee Type is set to Full time, have the checkbox for Laptop (variable - laptop) set to True

I assume it's a UI policy? but not sure how I write this out

 

 

5 REPLIES 5

Rajesh_Bhise
Tera Guru

Hello @Brian Sorensen ,

 

You can use below way to achieve it.

 

Write OnChang Client script on employee_type  variable.

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
 
if (employee_type  == "full_time){
    g_form.setValue('laptop', true);
}
if (employee_type  == "part_time){
    g_form.setValue('telephony_access', true);
}
Hope this find you easy.
 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer✔️ and helpful👍, this may help other community users to follow correct solution in future.

Happy to help you in future.😎

 

Thank you,
Rajesh

 

Thanks @Rajesh_Bhise 

Might be missing something

 

So the Employee Type I have tied to a variable set for Onboarding
the options for Employee Type are 

BrianSorensen_0-1702055025646.png

 

I used what you noted and it saved it on the variable, I changed the "full_time" to be the name "Full-Time Salaried"

 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (employee_type == "Full-Time Salaried"){
g_form.setValue('laptop', true);
}
//Type appropriate comment here, and begin script below
 
}

 

 

But since this saved on the Variable and not on the order guide itself, is there another step I need to do?

 

I then left it as applies to a Catalog Item and it looks like it saved, but doesn't seem to work

did I miss something?

 

BrianSorensen_2-1702055631683.png

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Brian Sorensen 

 

Very true it is UI policy and at catalog item level. Have a look OOTB New Hire order guide. No need to write the code.

 

LearnNGrowAtul_0-1702053378452.png

 

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

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

Hmm.. we don't have an OOTB New Hire guide.. I had to create mine from scratch in ITSM..

 

I'll poke around