onChange() Client Script looking at a form variable and modifying options in a Variable Set variable

FacundoA
Giga Expert

Hi! Can anyone tell me how to change or modify the options in a Select Box variable from a Variable Set using an onChange() Client Script that looks for a variable in the form?

The idea is that when the user selects a country in the form, it should affect the options in the Select Box from the Variable Set.

I created a Client Script that checks which country is selected and then uses GlideAjax to determine the selected country. In my Script Include, I return options = []; with values and labels. I can see this variable in console.log(), and it looks fine. However, I’m not sure how to access the Variable Set variable through the Catalog Client Script.

I tried different methods, such as name_variable_set.name_variable_from_variable_set, but it didn’t work. ex.  g_form.clearOptions('name_variable_set.name_variable_from_variable_set'); 

 

Can you please help me? Is it possible to achieve what I'm looking for?

 

1 ACCEPTED SOLUTION

FacundoA
Giga Expert

Multi row client script in variable set to get a variable value from catalog item form.

 

var workLocation = g_service_catalog.parent.getValue('name_of_the_variable_in_the_catalog_item');

View solution in original post

5 REPLIES 5

FacundoA
Giga Expert

Multi row client script in variable set to get a variable value from catalog item form.

 

var workLocation = g_service_catalog.parent.getValue('name_of_the_variable_in_the_catalog_item');