Adding requested for to variable set

ServNowDev
Tera Guru

is the requested for variable type able to be added to a variable set? getting this error

Screenshot_2025-09-02_at_4.04.44_AM.png

 

12 REPLIES 12

Raghav Sharma24
Giga Patron

Delete this and try creating the variable with same name in variable set.

I believe there is an OOB before BR running which is restricting this movement. 

No mate, it’s an OOB (out-of-the-box) field. Deleting it would not be a good practice.

Agreed. I thought is a custom variable being moved from variable set to catalog item

Shashank_Jain
Mega Sage

@ServNowDev ,

 

Add that in the variable set directly.

Create new variable of type requested for  in the variable set "Test Variable set".

Question - You wanted this on both variable set and catalog variables?

You needed 2 variable?

 

Ravi Gaurav
Giga Sage

Hi @ServNowDev 

Why you’re seeing the error

  • The Requested For variable is a special system-provided variable tied to catalog items.
  • It isn’t a standard variable type like Single Line Text, Reference, Choice, etc.
  • Because of this, when you try to add it to a Variable Set, the platform throws an error - ServiceNow doesn’t allow placing that special variable type in a reusable set.

 

If you need to include something equivalent in a variable set:

Create a Reference variable in your variable set.

Table: sys_user

Name it something like requested_for (or another logical name).

Configure default value as javascript:gs.getUserID() (if you want it to default to the logged-in user).

Apply catalog client scripts / UI policies if you need to mimic the OOB “Requested For” behavior.