Notifications

3 views

Issue

Symptoms

When trying to save the variable value in another field using a script  sys_id being displayed instead of name

Release

Madrid

Cause

Expected behaviour. It is storing the sys_id in the field as per the script used if the variable is a reference field:

current.<field_name> = current.variables.<variable_name>;

 

Resolution

Suggest to use the getDisplayValue() method to fetch the display name of the colleague. Something along the following lines:
current.variables.<variable name>.getDisplayValue()

Please refer the following documentation for further information on 'Reference' variables :
https://docs.servicenow.com/bundle/istanbul-it-service-management/page/product/service-catalog-management/reference/r_VariableTypes.html

 

Article Information

Last Updated:2019-08-02 20:42:34
Published:2019-06-04