- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 12:36 AM
I have a custom table which has a Category column (u_category). In the service catalog form, the Category field is referenced from the u_category column. The service portal catalog form will show the label/text value of the Category.
But when the ticket is opened in the backend, the field is showing the sys_id instead of the value.
How to display the value instead of the sys_id?
Can I use a client script to overwrite the field with the data value of itself? And if so, what is the syntax for it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 01:10 AM
Open referenced table
Open form
Right click on the field label (which field you want to see in reference field)
Set display to true
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 12:55 AM
Hello @Yi Ming Song ,
Make a use of .getDisplayvalue() where you are passing the sys_id as category field is reference field while setting it might be taking the sys_id
Please check the below article
getDisplayValue(fieldName)
Retrieve the display value for the specified field, if the user has permission to view that field's value.
Can only be called from the callback function after the query is complete.
Parameters
Name Type Required Description
fieldName | String | True | The name of the field to retrieve the display value for. |
Example
//Get assignment groups for child Incidents for some reason new EfficientGlideRecord('incident') .addQuery('parent', g_form.getUniqueValue()) .addField('assignment_group', true) //Get display value as well .query(function (egrIncident) { var assignmentGroupNames = []; while (egrIncident.next()) { assignmentGroupNames.push(egrIncident.getDisplayValue('assignment_group')); } //todo: Do something with the assignment group names });
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2023 01:10 AM
Open referenced table
Open form
Right click on the field label (which field you want to see in reference field)
Set display to true
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2023 07:54 AM
Helpful
out of the box solution