Notifications

142 views

Description

Overview


There are use cases where we need to acquire the value and label for multiple choice type of variables in the Service Catalog. This article should assist in guidance on how to achieve that.

Scripting


You can acquire the values needed via server side scripting such as Business Rules. 

 

To print out the value of the selected choice just run the following in your script (Replace <variable_name> with the name of your variable):

 

current.variables.<variable_name>

 

This works for all variables, not just multiple choice. 

 

If you would like to acquire the label of the selected choice, you can use the following code:

 

current.variables.<variable_name>.getDisplayValue();

 

This will return the Label (Question) of the multiple choice. 

 

 

Additional Information


For more information on variable scripting, please review the following documentation:

 

Scriptable Service Catalog variables

https://docs.servicenow.com/bundle/london-application-development/page/script/server-scripting/concept/c_ScriptableServiceCatalogVariables.html

Article Information

Last Updated:2019-08-02 20:56:02
Published:2019-01-07