Catalog Item - Variable - Choice List (set values)

Halo10110
Giga Contributor

How do I get these values with server script/client script from Catalog Items's variable choice list so they can be set to each (4) option in the portal?find_real_file.png

I am trying to get the values so when each of the options are clicked then it goes to workflow and it does 'something'...

find_real_file.png

This example is done in personal instance.

3 REPLIES 3

Ct111
Giga Sage

Hi,

 

You can set the values as per below sample

 

  var cat = g_form.getControl('category');

var catVal = cat.options[cat.selectedIndex].text;

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

  g_form.setValue("subject", 'Outage: ' + catVal + ' for ' + system);

 

Note : replaces  value in cat with   " business_purpose "   which is the name of your variable

 

Refer the below link incaseof doubt

 

https://community.servicenow.com/community?id=community_question&sys_id=a6b987e5db5cdbc01dcaf3231f9619b8

 

 

Mark my ANSWER as CORRECT and HELPFUL if helped

 

 

Halo10110
Giga Contributor

well I was more looking into the script where it would be done Widget Editor.

yes you can use similar concept in catalog client script don't worry try it and let me know if u r stuck.

 

Mark my ANSWER as CORRECT and HELPFUL if helped