Data dictionary and fields
Quick answer
How the data dictionary defines every field, which field types to choose, and the dictionary attributes that change platform behaviour.
Key takeaways
- Field type is a data decision, changing it later is a migration
- Use dictionary overrides instead of duplicating fields on child tables
- Attributes control lookup, sorting and encryption behaviour
- Name fields with the u_ prefix in global scope so custom columns are obvious
The dictionary defines the table
sys_dictionary holds one record per field plus a collection record per table. Column name, type, length, default value, mandatory and read only all live here. Editing a field from a form opens the same record.
Choosing the right type
Type decides storage, indexing and how the field behaves in filters.
- String with a sensible max length, not 4000 for everything
- Choice for a fixed set of values, with the choices held in sys_choice
- Reference when the value is another record, never a string copy of its name
- True/False for flags, not a string with yes and no
- Date/Time for anything time based so timezone conversion works
Dictionary attributes
Attributes are the switches that most people never open. Common ones are edge_encryption_enabled, ref_auto_completer for reference lookup style, no_sort to keep a column out of sorting, and max_length behaviour for long text.
Dictionary overrides
On extended tables you can override the parent definition per child table: default value, mandatory and read only. This is how incident can require a category while other task tables do not.
Want to learn this properly?
Our live, instructor-led ServiceNow Training covers this hands-on, with real projects and a certification path.
Check your understanding
Where are the values of a choice field stored?
- A. sys_dictionary
- B. sys_choice
- C. sys_ui_element
- D. sys_properties
Show answer
B. sys_choice
Choice values live in sys_choice, keyed by table and element.
What does a dictionary override let you do?
- A. Rename a parent field
- B. Change default, mandatory and read only for a child table
- C. Delete an inherited field
- D. Change the field type per view
Show answer
B. Change default, mandatory and read only for a child table
Overrides adjust behaviour of an inherited field on one extended table.