Reusing variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2016 07:19 AM
Hi All,
I have a questions. Can custom variables be reused in variable sets? what about without variable sets? If so, are there any pros or cons to this?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2016 07:36 AM
Hey paradise623,
So one thing I noticed is that there's a lot of form transformations going on here. Also, when I was looking at the Catalog Item it was missing the Catalog UI Policies tab, which I added for you.
Good thing I did, since there was 4 active UI Policies. What I noticed is the "number_of_rooms" variable appears in each. ServiceNow tends to be picky about the same variable being modified by different UI Policies of the same order. Think of it like 4 traffic cops all giving you different directions simultaneously.
I also noticed that in each case you want the "number of rooms" to be set to true. This means there's no case where you *don't* want the number of rooms to be hidden. Because of this, I'd simply remove Number of Rooms from the 4 UI Policies and just place it on the form above the request_type label.
Does that all make sense?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2016 09:40 AM
The UI Policy only applies to the variables in use during that specific session, if that helps. You don't want to have the same variable used multiples times on the same form however, that just doesn't work.