Why getDisplayValue() displaying sys_id instead of value for glide list type field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2024 09:37 PM
Hi Community,
I have a glide list type field and I want to copy display value of that field to another field of string type.
I created a before- insert/update Business rule for the same with below code:
current.field1=current.field2.getDisplayValue();
gs.addInfoMessage(current.field1);
The above info message is displaying sys id instead of value.
Please someone help on this.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2025 09:29 PM
did you try running script in background?
query 1 record from that table and try to print the display value
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2025 09:57 PM - edited 01-01-2025 09:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2025 11:18 PM
then it should work fine in your BR script as well
are you sure the record for which BR runs has "Choice value" (the display field) populate in those?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2025 11:36 PM
@Ankur Bawiskar Yes , choice value has been already populated on all Entity Update table records.
I don't have any idea what's the issue here. It should work fine .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-01-2025 11:38 PM
I could see encryption is enabled for the List field i.e. groupings
Can you disable that and verify running the BR?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader