4.1,4.2: Table Administration Flashcards
Lists and Forms
Lists and Forms provide a user-friendly interface for managing tables, records, and fields.
ServiceNow Infrastructure
Everything in ServiceNow is built on a relational database accessible through the ServiceNow Platform.
Lists and Forms provide a user-friendly interface for
The ServiceNow infrastructure includes tables, records, and fields.
Tables contain records. Records correspond to rows in a table. A field is an individual column of data. The value is the data where the field and record intersect.
Data in ServiceNow i s stored and managed according to a database structure that administrators can view and configure:
- Tables are a dat a st ruct ure or dat abase component , w hich cont ain records
- Records are t he dat a st ored in t ables, w hich cont ain fields
- Fields are indiv idual pieces of dat a w i t hin a record
- Values are indiv idual dat a element s t hat can be accessed t hrough a field in a record. 134
The System Dictionary contains the definition for each and every table and field in the database.
Nav igate t o Al l > System Defi nition > Di cti onary t o access t he syst em dict ionary t o modify t able and field at t ributes. 134
Adm ini st rators can use these tools for viewing and modifying the database structure:
*T abl es module: Provides a li st of al l t ables in t he dat abase.
*T abl es & Col umns modul e: Provides a li st of al l exist ing t ables, w ith columns, column at t ributes, and indexes.
NOTE: Tables can be creat ed t hrough eit her of t hese modules.
Schema map: Prov ides a graphical represent at ion o f t he relat ionships bet w een t ables.
Data dictionary tables: Cont ains addi t ional information t hat defines dat abase element s. 134
Table Components
A table is a collection of records in the database.
*A record corresponds to a row in a table
(e.g., info about a single user)
*A Field corresponds to a column in a table (e.g., User ID or email)
*A Value is where the field and record intersect
(e.g., Paris, Rome, Miami, etc)135
Records
Records are identified by a 32-character, globally unique ID, called a sys_id .
Record numbers can be automatically increment ed, and t he number format per t able in t he system can be changed by visiting the All > System Definition > Number Maintenance application. 135
Field Attributes
Each field has three key attributes: a label, a name, and a value. *Field Label
The label is a user-friendly term which allows people to identify the field in the user interface.
*Field Name
The field name is a system-friendly unique term that the system uses to identify the field.
*Field Data
The values are actual data entered into the field.
Field Label, Name, Data
Field data represent an individual item of data on a record, such as this user’s name, Alejandro Mascall , or his location, Frankfurt. In some cases, the value may be null (empty).
The field name is a unique term that does not always match a field’s label. For example, notice that the field name “city” is the system-friendly field name in the sys_user table that corresponds to the user-friendly field label “Location”.
The field names shown in this example are first_name, last_name, and city. They correspond to the field labels, First Name, Last Name, and Location. 136
Reference fields
are identified with the reference lookup icon (ikona lupy).
The reference lookup icon opens a dialog box for locating a record to reference, presented as a list of the referenced (target) table.
If a record is specified in the reference field on the source table, you can select the reference icon to preview the referenced record (on the target table).
A reference field
stores a unique system identifier (known as the sys_id) of a record on another table which is what establishes the reference relationship. For example, the Caller field on the Incident table is a reference to a record on the User [ sys_user] table.
*When you define a reference field, the system creates a relationship between the two tables. Adding a reference field to a form makes the other fields in the referenced table available to the form. Wildcard searches can be used in reference fields.
*NOTE: A reference field can refer only to records from one other table. To add a field that can refer to records on any table, use the Document ID element type.
*Administrators can create new reference fields and configure several options for reference fields. 137
Table Relationships
Tables can be related to each other in various ways.
*One-to-Many
*Many-to-Many
*Database Views
*Extensions
One-to-Many
Request->Requested Item1,Requested Item2.
Within a table, a field can hold a reference to a record on another table.
Many-to-Many
Role A, Group A, Role B, Group B, Group Roles.
Two or more tables that can be related in a bi-directional relationship.
Database Views
CMDB CI, Uptime Metrics.
Tables that can be joined using the Database Views plugin.
Extensions
Incident Table-Extended table, Task table-Parent table.
A table that extends another table.
One-to-Many : There are t hree one-to-many relat ionship fields:
- Refer ence Fi el ds - Allow s a user t o select a reco rd on a t able defined by t he reference field. Example: Cal ler field on t he Incident t able allows a user t o select any record on User t able.
- Gl i de Li st - Allow s a user t o select mul t iple records on a t able defined by t he glide l i st . Example: The Wat chli st field on t he Incident t able allows t he user t o select any record or records on t he User t able.
- Document ID Fi el ds - Allow s a user t o select a record on any t able in t he inst ance. Example: Document field on t he Translat ed Text t able. 138
Many-to-Many :
Tw o or more tables can be related in a bi-di rectional relationship, so t hat t he relat ed records are v i sible from bot h t ables in a relat ed li st . Think ahead! Your dat a model i s important. Plan so t hat you get t he model right t he fi rst t ime. A common example of a many-t o-many relat ionship i s one bet w een st udent s and classes. A st udent can regi st er for many classes, and a class can include many st udent s. If you are w orking w ith many -to-many relat ionships in Serv iceNow, you may find sys_collect ions.li st and sys_m2m .l ist useful .
Database Views :
A dat abase v iew defines t able joins for reporting purposes. For example, a dat abase v iew can join t he Incident t able t o t he Met ric Defini t ion and Met ric Inst ance t ables. Thi s v iew can be used t o report on incident met rics and may include fields from any of t hese t hree t ables. The dat a in t he v i rt ual t able creat ed by a dat abase v iew i s read - only. Creat e Dat abase View s by nav igat ing t o System Defi nition > Database Vi ews.
138
Extensions:
The extended table includes unique fields plus al l o f t he fields and t heir propert ies from t he parent t able.