Variable vs Field

pauladams
Tera Contributor

Could someone please explain the difference and usage of Variables & Fields?

For me it looks like variables are meant for catalog items and visible for normal users and Fields are meant for ITIL users/assignment group members. Is my understanding correct?

Also, I see a variety of variables of "drop down" type - Choice, Multiple Choice, Lookup Multiple Choice, Lookup Select Box, Select Box, Reference, List Collector.

Do fields too have the same variety?

Thanks

3 REPLIES 3

darius_koohmare
ServiceNow Employee
ServiceNow Employee

Variables and fields have different options, and are used in different contexts.


Variables are meant to be a way to hold item specific data without cluttering an actual table with fields.


To clarify, fields are columns on an actual table (e.g. category on incident), whereas variables exist on their own variable table, with a relationship to a given record such as a requested item.



Many different catalog items (e.g. software, hardware, etc.) will have many questions you want to ask the user - what color, what size memory, what OS, etc. All this data needs to live somewhere in the system. Without variables, the option would be on the actual requested item (or other) table. The number of columns would be extremely inefficient. With variables, all this data can now be stored and linked to the relevant record without adding columns to the core table.



Fields have many more types than variables, check out the full list here: Field types


Thanks Darius darius.koohmarey


So Variables are used only in the catalog items?


They are used in other areas as well, such as record producers, workflows, and notifications.


But the concept is the same - they are intended for data that is not intended to live on an actual core table.


Another example - you have a record producer in the service catalog which creates a record on the incident table. This record producer is called 'Flight Issue'. On this, there is a reference field asking for the location that you started in (departure) and the location that you ended in (arrival).



Now, for any incident that is not made from this flight issue record producer, it wouldnt make sense to track the departure and arrival locations. Because of this, you don't want to make a 'departure' and 'arrival' field on the incident form, and instead stay with the variable data.



Finally, there's security concerns- maybe you don't want to give a user write access to a table, but you want them to create a record and submit it. They can do so by submitting a record producer and having the variable data mapped to the actual fields on the table.