New "Hide" variable field (onLoad) - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Hi there,

 

Scrolling through the Quebec release notes for Service Catalog improvements, you might have noticed the three improvements for Variables. One of these, "Make a variable read-only or hide it while defining the variable". This sounds promising, solving cases for which you would create a dummy onLoad Catalog UI Policy and UI Policy Action to hide a Variable.

 

Let's have a closer look.


Quebec: Enhancements for variables

The Service Catalog release notes mentions:

  • Make a variable read-only or hide it while defining the variable.
  • Make a question choice inactive.
  • Make a group of CheckBox variables mandatory in Service Portal.


Hiding Variables onLoad

There are cases where you need a Variable that will not be visible when submitting a Catalog Item, or Variables that should get Visible conditionally after (multiple) conditions have been met. In those cases, the Variable needs to be hidden onLoad. Up to now, you would achieve such only by creating a Catalog UI Policy and Catalog UI Policy Action or through an onLoad Catalog Client Script.

 

This is where the new "Hidden" field on Variables come into place!

 

find_real_file.png

 

This sounds promising. Simplifying Catalog Items, eliminating some dummy Catalog UI Policy and Catalog UI Policy Actions and Catalog Client Scripts.


Hiding Variables conditionally

So what if you still need to make the Variable visible, due to some conditions in your Catalog Item design? I tested with Catalog UI Policy and Catalog UI Policy Action and Catalog Client Script, no issues at all! Just your regular way of making a Variable visible.

 

find_real_file.png

 

find_real_file.png


Result

Such a small and simple enhancement to Variables which you might overlook pretty easy. Though such a nice enhancement! Eliminating components that previously were really needed, reducing complexity, and now just a simple checkbox on the Variable itself.

 

A welcome small though very effective enhancement!

---


And that's it actually. Hope you like it. If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

ServiceNow Technical Platform Architect @ Quint Technology

2x ServiceNow Developer MVP

2x ServiceNow Community MVP

---

LinkedIn

Comments
Antonio39
Tera Contributor

hi,

is there any limitatin in usign "hidden" flag?
Actually i'm working on 7 variable sets (each of which contains 30 variables on everage). 

each variable set is called by 1 to 10 catalog items,

so i flagged "hidden=true" for every variable involved.

 

Initially no troubles at all, with 1 or 2 variable sets,
but now that are 5 troubles coming in loading items on Employee Center,

or clicking "Try It" on catalog item record, or in loading Requested Item tables.

 

Any advice?

Thanks in advance.

Version history
Last update:
‎08-12-2024 09:14 AM
Updated by:
Contributors