- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 09:16 AM
Hi
I am working on a Custom application.
we have field called Address , type of field= List
I want to add this field to popup. i am using below code to get display Value but it is displaying sys_id.
How to get Display value from list
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var duplicateCase = new GlideRecord('x_sor_goods_service_case');
if (!gs.nil(current.req_number) && !gs.nil(current.identification_address)) {
//duplicateCase.addActiveQuery();
duplicateCase.addQuery('sys_id', '!=', current.sys_id);
dduplicateCase.query();
if (duplicateCase.next()) {
current.state = '3'; //Closed
current.close_notes = 'This case is duplicate of ' + duplicateCase.number + '. Has the same request number and address: ' + current.req_number + " -> " + current.getDisplayValue('identification_address') + '.';
current.setWorkflow(false);
current.autoSysFields(false);
current.update();
return;
}
}
})(current, previous);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 08:29 PM
that list field refers to which table?
On that table any field is marked as Display=true?
if not then it will give sysId
If some field is marked as Display=true then it will show that
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 09:37 AM
try this line
current.identification_address.getDisplayValue()
current.close_notes = 'This case is duplicate of ' + duplicateCase.number + '. Has the same request number and address: ' + current.req_number + " -> " + current.identification_address.getDisplayValue() + '.';
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 09:37 AM
Please mark my response as correct to one of your earlier question since it worked for you
how to copy Task skills related list values to a List type field in servicenow
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 09:57 AM
Actually i am doing getDisplayValue() only not working.
tried both approach it is showing sys_id not display value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2025 08:29 PM
that list field refers to which table?
On that table any field is marked as Display=true?
if not then it will give sysId
If some field is marked as Display=true then it will show that
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader