Java script to show Department name and Department ID for the reference list in search
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 06:12 AM
The Department variable in a catalog item is setup as a reference. The search lists only shows the department name, how do i get the department ID to also show up with the department name in the search,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 07:08 AM
Hi @MIcheleWilliams ,
For each table there is only one display field.
You can set Department ID Display True Using Configure -> Dictionary function.
Or you can set display true for any field from table entry in sys_db_object table.
You cannot set display true for two fields.
If my response helped, please hit the 👍Thumb Icon and accept the solution so that it benefits future readers.
Regards,
Pratik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 07:09 AM
you should use ref_ac_columns attribute in your variable attribute and include your columns
ref_ac_columns=id
Example: I did for Server table
ref_auto_completer=AJAXTableCompleter,ref_ac_columns=category;serial_number,ref_ac_columns_search=true,ref_ac_order_by=name
Variable attributes sections
Output: I have added category and serial_number as extra fields to be shown along with name
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
04-27-2025 08:13 AM
Hope you are doing good.
Did my reply answer your question?
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-04-2025 08:13 AM
Hope you are doing good.
Did my reply answer your question?
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