- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 11:19 AM
I created a Department ID field in the Service Catalog referencing cmn_department, but it's showing the department name instead of the department ID. How can I fix this?"
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 10:41 PM
you can use Lookup select box type variable and show Department ID in drop down rather than using Reference variable
Steps
1) Variable Config
Output:
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-22-2025 11:26 PM
Hi @Arun kumar Chin ,
changing the table’s display value
You can change the cmn_department table so it shows the ID instead of the name everywhere. But this change will affect the whole platform — not just the catalog — so it's usually not a good idea.
2-
when you use a reference field pointing to the cmn_department table, it shows the department name, because that’s the default display value. To also show the ID, you can keep the reference field as it is and add another read-only text field to show the ID.
To do this, first, add two variables in your catalog item: one reference variable for the department (like department_name) and one read-only text variable to display the ID (like department_id_display). Next, add a catalog client script that runs when the user picks a department. This script uses GlideAjax to call a Script Include. The Script Include receives the selected department’s sys_id, looks it up in the cmn_department table, and returns the department ID. The script then takes that returned value and puts it in the read-only field on the form.
This way, the user selects a department by name, and the system automatically fills in the correct department ID next to it. It’s a clean and simple way to show both values without changing how reference fields work in ServiceNow.