Variables populating based on custom Table

servicenow14710
Tera Expert

testexcel.png

Hello developers,

I have custom table attached with columns as eg: system and its info.

And for system and info i have two different select box on catalog item,

Based on system i select its respective systeminfo has to be populated in another selectbox info variable.

Any help is appreciated. Thanks!

 

1 ACCEPTED SOLUTION

@servicenow14710 , On the Variables - this is the Only Option to create dependency 

 

If you want to call your choices from your custom table on to the Variables and create dependency Refer to this Below Article 

 

https://www.servicenow.com/community/developer-articles/dependent-select-box-choice-variables-on-rec...

 

Regards.

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

View solution in original post

4 REPLIES 4

swathisarang98
Giga Sage
Giga Sage

Hi @servicenow14710 ,

 

You can use Auto populate feature in catalog item variable to auto populate the field values ,

in system info variable select the system as reference field and in Dot walk path select "system info " 

swathisarang98_0-1710009290350.png

 

If still clarification is required please go through below article,

https://www.servicenow.com/community/developer-articles/auto-populate-a-variable-based-on-a-referenc... 

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

shyamkumar VK
Kilo Patron

@servicenow14710  ,  Design On change Client Script on "System" Variable and below is the Script , If you want to Include more Option Just add few more Addoptions into your Script 

 

function onChange(control, oldValue, newValue, isLoading) {
    if (newValue == '') {
        return;
    }

    var choice = g_form.getValue('system');

    if (choice == 'android') {
        g_form.clearOptions('system_information');
        g_form.addOption('system_information', 'ops', 'ops');
        g_form.addOption('system_information', 'secops', 'secops')

    } else if (choice == 'mac') {

        g_form.clearOptions('system_information');
        g_form.addOption('system_information', 'max', 'max');

    }

}

 

 

Regards,

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Hi @shyamkumar VK, thanks for quick reply what if the choices are unlimited, as you have given static. Thanks! 

    if (choice == 'android') {

 

@servicenow14710 , On the Variables - this is the Only Option to create dependency 

 

If you want to call your choices from your custom table on to the Variables and create dependency Refer to this Below Article 

 

https://www.servicenow.com/community/developer-articles/dependent-select-box-choice-variables-on-rec...

 

Regards.

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar