The CreatorCon Call for Content is officially open! Get started here.

Reusing variables

paradise623
Giga Expert

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!

16 REPLIES 16

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.


Inline image 1



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.


find_real_file.png




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.


find_real_file.png



Does that all make sense?


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.