Requested For Variable Showing Logged-in User on RITM/SCTASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
Hi Team,
I'm facing an issue with a catalog item that uses a Variable Set containing a Requested For reference variable.
On the catalog form, the correct user is selected. After submission, the Requested For field on the RITM and SCTASK records also shows the correct user.
However, in the Variables section (Variable Editor) of the RITM and SCTASK, the Requested For variable displays the name of the currently logged-in user viewing the record instead of the user selected during submission.
The same Variable Set is used by other catalog items and works correctly. The issue occurs only with this specific catalog item.
I have already checked:
- Variable Set configuration
- Business Rules
- UI Policies
- Catalog scripts
and couldn't find anything related to this item.
Has anyone encountered a similar issue?
Thanks in advance for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
any catalog client script or catalog UI policy is running on RITM and SCTASK which is setting the logged in user in that variable
did you check in the backend table "sc_item_option_mtom" what value is stored in that? If it's the value user selected during submission and not logged in user then some script is setting that on form
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @PALAVALASAB
1)
An onLoad Catalog Client Script attached directly to this specific item is likely executing on the RITM/Task views without proper validation.
- Go to the Catalog Client Scripts related list on the Catalog Item.
- Look for an onLoad script where Applies on Requested Items or Applies on Catalog Tasks is active.
- Look closely at the code wrapper.
function onLoad() {
if (isLoading) {
return;
}
// Script logic...
}
Note: If the script lacks the if (isLoading) { return; } logic, or if a developer deliberately bypassed it to explicitly populate the current user via g_user.userID, it will overwrite the variable's true data every time any analyst views the form
2)
- Look at the Catalog UI Policies related list.
- Scan for policies where Applies on Requested Items or Applies on Catalog Tasks is checked.
- Check if any associated UI Policy Actions target your Requested For variable.
- Check the Script tab of these policies. If there is a script executing g_form.setValue(),
+Also verify it isn't accidentally pulling the active session user via g_user
3)
check if this specific Catalog Item has a Variable Attribute or Catalog Item Variable Override.
- Make sure that a default value expression like javascript:gs.getUserID(); hasn't been reconfigured or overridden at the item level.
- Refer KB: KB0717013 How to correctly store the logged-in user in a Service Catalog variable
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti