- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2022 05:27 AM
Hi Team,
My reference field is visible like this:
IM Argentina Operating Unit
IM Argentina Operating Unit
IM Argentina Operating Unit
IM Argentina Operating Unit
IM BR OU
IM BR OU
.............
But I need the unique Values.
How to achieve this requirement?
Thanks,
Yesh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2022 09:29 PM
Hi
Why don't you get all sysid into an array, then use unique of arrayUtil class.
Then you can populate the select box with the unique values of array.
Api | ArrayUtil - ServiceNow Developers
Hope this helps!
Thanks,
Nikhil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2022 05:37 AM
Hello Yesh,
Please try:
field = current.getValue(field_name);
As opposed to getDisplayValue - this will return the sys_id of the reference field.
Hope this helps!
Tudor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2022 05:49 AM
Hi Tudor,
I want the field Values only and these should be unique. I don't want sysID.
Thanks,
Yesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-10-2022 10:38 AM
Go to the sys_db_object table, find your table, and set the field you want displayed as the display field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2022 09:00 PM
Hi Chris,
I have already set the display field. Here I need the unique values of that field. Do you have suggestion for this?
Thanks,
Yesh