Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Variable Sets

DeIvory Gordon
Tera Guru

Hello,

I need to inactivate to fields on a form.  The fields/variables are in a variable set. The variables is included in two other forms and if I inactive them they will not be visible on the other forms as well.  I am trying to think this through.  I tried to create a variable "Active Directory Group" like the variable in the variable set and I was going to inactivate it, but I got the error there are two variables with the same name and I have to create unique variable names. Do you know what can be done to remove the two variables/fields from the form without removing them from the two other forms?  Thanks!

 

 

DeIvoryGordon_0-1761142403272.png

 

2 ACCEPTED SOLUTIONS

GlideFather
Tera Patron

Hi @DeIvory Gordon,

 

every variable on a particular form must have unique name. So if you are moving any variables, they cannot have the same name... the label can be the same but not the name.

 

Example Label (what you see) Requested by and Name (requested_by).

 

So if you update the variable names, not to collide then you will be able to do whatever you want.

But be careful because the variable name can be associated with either field mapping and/or scripts and catalog ui policies... so be aware you will not break any of this.

 

Good luck and let me know whether that helped

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


View solution in original post

Ankur Bawiskar
Tera Patron
Tera Patron

@DeIvory Gordon 

why not hide them using onLoad catalog client script OR catalog UI policy on that item?

Use "Applies to" -> Catalog item

Yes you should use Unique variable names always

💡 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  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

2 REPLIES 2

GlideFather
Tera Patron

Hi @DeIvory Gordon,

 

every variable on a particular form must have unique name. So if you are moving any variables, they cannot have the same name... the label can be the same but not the name.

 

Example Label (what you see) Requested by and Name (requested_by).

 

So if you update the variable names, not to collide then you will be able to do whatever you want.

But be careful because the variable name can be associated with either field mapping and/or scripts and catalog ui policies... so be aware you will not break any of this.

 

Good luck and let me know whether that helped

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */


Ankur Bawiskar
Tera Patron
Tera Patron

@DeIvory Gordon 

why not hide them using onLoad catalog client script OR catalog UI policy on that item?

Use "Applies to" -> Catalog item

Yes you should use Unique variable names always

💡 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  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader