We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Requested For Variable Showing Logged-in User on RITM/SCTASK

PALAVALASAB
Tera Contributor

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.

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@PALAVALASAB 

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! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Tanushree Maiti
Tera Patron

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.

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti