How to populate catalog variable on the RITM when hidden on catalog item view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2025 08:27 AM
I am working with a catalog item that has TWO variables that are both hidden on the catalog item view but are visible on the RITM. Both variables are a "reference" type.
These variables will be the Cost Center and the Employee ID of the requested for.
* The cost center variable references the Cost Center table [cmn_cost_center]. The variable name is 'cost_center'.
* The Employee ID references the [sys_user] table. The variable name is 'employee_number'
When I first had these variables visible on catalog item view, these both auto populated at the catalog item view, but upon submission, the cost center DID carry over to the RITM, but the employee #ID did not (even when it was visible on catalog item view at submission).
I now have set both as "hidden" on catalog item view, and via UI policy, are visible on the RITM.
Upon submission, the cost center still carries over to the RITM (it's not visible on catalog item view, it simply pulls over the cost center or the requested for.)
The Employee ID is showing blank at the RITM level is it's not populating the employee id of the requested for.
- employee_number is field on [sys_user] table and that's the name of the variable
Any ideas on how I can get the requested for employee # to be filled in on the employee_number variable at the RITM level?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2025 08:39 AM
My initial assumption here would be that there is something clearing out the value of the employee number when the RITM loads (onload).
So do these below.
1. Add an onsubmit client script to alert the value of the employee_number variable. This will allow you confirm that there is a value in there.
2. Check to ensure there are no UI policy that is clearing the value of the employee_number onload.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2025 08:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2025 08:48 AM - edited 06-06-2025 08:50 AM
Employee id should be a string type field. So, change the type of the "Employee ID" variable as single line text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2025 08:56 AM
any UI policy is clearing it before submission and hence possibly it's not getting carried over?
Did you try to disable the ui policies acting on those to hide on catalog item view?
Also how are you populating those?
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