Catalog Item - Variable - Choice List (set values)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2018 08:53 AM
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?
I am trying to get the values so when each of the options are clicked then it goes to workflow and it does 'something'...
This example is done in personal instance.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2018 09:00 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2018 09:27 AM
well I was more looking into the script where it would be done Widget Editor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-04-2018 09:45 AM
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