ServiceNow Variables

I’ve been working a lot with variables lately. Here are some things that I’ve learned that either weren’t in my classes up to this point, or which didn’t stick for me when my classes covered them.

1. If a variable is refusing to be hidden, check to see if it is mandatory. I can’t say categorically that mandatory variables can’t be hidden, but I’ve definitely seen instances where a variable refused to hide until after it was no longer mandatory.

2. If you have something that isn’t behaving the way you are expecting it too, check that you don’t have a container that isn’t closed out. That can cause behavior that has been applied to the container to apply to variables that you don’t realize are part of the container.

2a. It’s implied by 2. above, but worth being called out specifically. I’m used to more specific rules trumping more general rules. That isn’t how containers and variables work. Instead, the less specific (UI Policies applied to a container) trumps the more specific (UI Policies applied to the variables inside of the container). If you make a container mandatory, you can’t set one of the variables inside the container to not be mandatory. You would have to set the container to be non-mandatory, and then individually set the other variables mandatory.

 

Leave a Reply