Introduction to Fields
| Note: This article applies to Fuji and earlier releases. For more current information, see Field Administration at http://docs.servicenow.com
The ServiceNow Wiki is no longer being updated. Visit http://docs.servicenow.com for the latest product documentation.
- 1 Overview
- 2 Field Types
- 3 Creating New Fields
- 4 Changing the Field Label or Hint
- 5 Modifying String Field Length
- 6 Deleting Fields
- 7 Field Status Indicator
- 8 Field Reference
- 9 Enhancements
The individual pieces of data in a record are called fields. Users can enter data in fields by using the list editor or by using a form. In form view, fields appear as fields in the form, and in list view they appear as columns of data in the table.
Administrators can create new or modify existing fields.
2 Field Types
These field types are available to administrators when creating new fields or changing the type of existing fields.You cannot change a field's type without data loss. For custom fields, the system prompts you to confirm you accept the data loss before proceeding with the change. For a base system field, the system prevents you from making the type change. Also see Scripting of Field Types.
|Note: If you edit a field on a child table that is present on the parent table, you will also change it for the parent table and all other child tables.|
|Choice||Drop-down list of choices that can be customized. See Choice Lists.|
|Color||String field that accepts CSS color declarations (including hex or RGB notation) and displays a preview. See:|
|Composite||Combines and displays two different types of information in one field; for example, a project number and short description. Composite fields are used in the Demand Management and Project Management applications.|
|Conditions||Field that adds the condition builder to a form. You must specify a dependent field that references the table name.|
|Currency||Decimal field with two digits after the decimal point. When displayed on a form, a currency field also includes an additional choice list for selecting the currency type. See Localizing Price in the Service Catalog. If there is no default value for the field, empty currency fields use the default system currency. Adding a value causes the field to use the preferred currency of the active user.|
|Date||Day, which can be selected with a calendar widget.|
|Date/Time||Day and time of day, which can be selected with a calendar widget.|
|Decimal||Number with up to two digits after the decimal points (for example, 12.34).|
|Document ID||Reference to any field on any table. See Creating a Document ID Field.|
|Due Date||String input field that stores a date-time.|
|Duration||Length of time. Stored in the database as a positive integer number of milliseconds, but displays in days, hours, minutes, and seconds. Negative duration values are not supported.|
|Floating Point Number||Number with up to seven digits after the decimal point.|
|HTML||String field with a built-in HTML editor. See Using HTML Fields and Modifying HTML Fields.|
|Image||Field for uploading and embedding images.|
|Integer||Number with zero decimal points.|
|Journal||Field that accepts text entries and displays previous entries with a user name and timestamp. See Using Journal Fields.|
|Journal Input||Field that accepts text entries but does not display previous entries. See Using Journal Fields.|
|Journal List||Field that displays the contents of journal fields. You must specify the journal fields as the dependent fields. If a journal list field is dependent on more than one journal field, the entries are displayed chronologically. See Using Journal Fields.|
|List||Reference field that accepts multiple references rather than just one. See Configuring Watch Lists.|
|Password (1 Way Encrypted)||Text field that stores passwords with one-way encryption. One-way encryption stores the password as a secure hash value that cannot be decrypted.|
|Password (2 Way Encrypted)||Text field that stores passwords with two-way encryption. Two-way encryption stores the password as a secure encrypted value that can be decrypted programmatically within the instance. You can use Password 2 encryption with form variables. To encrypt text fields on forms, use Encryption Contexts.|
|Percent Complete||Decimal field that renders a percent complete bar in lists. See Creating a Percent Complete Field.|
|Phone Number (E164)||String field that provides E164-compliant formatting and validation for telephone numbers (starting with the Dublin release). See Using Phone Number Fields.|
|Price||Decimal field with an additional drop-down for currencies. See Localizing Price in the Service Catalog.|
|Reference||Query that displays records from another table. See Reference Fields.|
|String||Character string. For String type fields, a length of under 256 appears as a single-line text field and anything 256 characters or over appears as a multi-line text box.|
|Suggestion||String field that provides suggested values but accepts free-form text. Available when you add a field by customizing a form or list. Otherwise, you must modify the dictionary entry of an existing string or journal field. See Adding Suggestion Fields.|
|Time||Specific time. Stored in the database as an string in milliseconds, but displays in hours, minutes, and seconds. It only stores a time value of up to 24 hours. For example, if you put in 30 hours the form will display 06:00:00 instead of 30:00:00|
|Translated HTML||HTML field that displays different translations based on the user's language. See Using Translated Text.|
|Translated Text||Text field that displays different translations based on the user's language. See Using Translated Text.|
|True/False||Boolean field that appears as a check box.|
|URL||String field that is a clickable URL field when locked.|
|Video||Field for uploading and embedding video.|
|Wiki||String field with a built-in Wikitext editor that accepts a simplified version of standard Wikitext formatting. See Wiki Fields.|
|Workflow||Choice list field that displays a stage in a workflow. See Creating a Workflow Field.|
|Note: When you create a custom field, use one of these supported field types. Other field types, such as User Input, are for internal use only and are not supported for custom fields.|
3 Creating New Fields
To add a new field to a table:
- Navigate to any form.
- Right-click the form header and select the appropriate option for your version:
- In the Create new field section, fill in the following fields:
- Name: Enter the name of the field as you want it to appear on forms and lists.
- Database column name: Enter the database name for the field.
- Type: Select a field type.
- Field length: Select a field length. This field is visible only for certain field types.
- Click Add.
- Use the slushbucket to place the field in the desired location on the form.
- Click Save.
- The field now appears on the form in the designated location.
For more information, see Creating New Fields.
4 Changing the Field Label or Hint
To change label or hint, navigate to the form the field appears on, right-click the field label, and select Configure Label (Personalize Label in versions prior to Fuji).
Populate the following fields:
|Table||The table the label appears on.|
|Label||The label that the field will display. You can enter up to 50 characters for the label, but not all databases support this many characters. The recommended maximum is 30 or fewer characters.|
|Plural||The plural version of the field label.|
|Element||The dictionary name of the field.|
|Help||Helpful text stored in the record.|
|Hint||A short description of the field that will display when the user hovers over it. For more information see Field Label Help.|
|URL||A URL link that will display on the label. For more information, see Field Label Help.|
|URL target||A target attribute that determines where the URL will open. For information on the target attributes, see this W3Schools article.|
If a field is on a base table, like task, a different label can be defined for each extended table, like incident or problem. To add a different label for an extended table, Navigate to System Definition > Language File, and create a new entry for the extended table. Table is the extended table name, like incident or problem, and Element is the field name.
Tables that do not extend the same parent table cannot share the same field labelled differently.
5 Modifying String Field Length
5.1 Increasing the Length
To increase the length of a string field (e.g., from 40 characters to 100 characters):
- Right-click the field label in the form and select Configure Dictionary (Personalize Dictionary in versions prior to Fuji).
- Change the max_length field to the desired length.
- Increase it to the desired length.
For 254 characters or less, the string field will be a single-line text field. Anything 255 characters or over will appear as a multi-line text box.
|Note: The database may translate the value you provide in the max_length field to the closest matching database field type. For example, a max string length of 80 maps to the nearest database field type of VARCHAR(100). See Database Field Types for common database field types.|
Note for Oracle instances: Users will not be able to increase the max_length of a string field to anything greater than 4000 through the application UI as this requires the CLOB datatype in Oracle. If you require a field to be larger than this, you can log an incident to request that our DBA make this change for you.
5.2 Reducing the Length
To prevent inadvertent truncation of data, a business rule named "Dictionary Change Rationally" prevents reducing the length of a string field. If you must shorten a string field, you can temporarily disable this business rule. Note that it is there to protect your data and should be enabled by default.
5.3 Text Field Character Counter
By default, multi-line text fields have a 4000 character limit. To help users see how many characters remain before they reach the limit, administrators can enable the glide.ui.textarea.character_counter property. This property adds a counter under text fields, such as the Additional Comments and Work notes fields. The counter is dynamically updated as users enter text.
To enable the property:
- Navigate to System Properties > UI Properties.
- Select the check box next to Character counter for textarea (journal and multi line text fields).
- Click Save.
6 Deleting Fields
Typically, deleting a field is discouraged. Instead, remove a field from forms and lists.
For custom fields (the field name begins with u_), navigate to the dictionary record for that field and click Delete Column. To access the dictionary record for a field, open the form for that table, right-click the field label, and select Configure Dictionary (Personalize Dictionary in versions prior to Fuji).
Administrators can delete multiple custom fields from the System Dictionary (System Definition > Dictionary).
Base system fields cannot be deleted. Additionally, any missing base system fields are recreated when the instance is upgraded.
7 Field Status Indicator
Indicators are used on some fields to denote a special field type. For more information, see Field Status Indicators.
8 Field Reference
The following sections contain reference information about fields.
8.1 Database Field Types
The following shows available field types and their corresponding MySQL database types. Typically, it isn't necessary to perform any actions on the database level. To learn about changing a field type, see System Dictionary.
|Field Type||Options||Dictionary XML Type||MySQL DB Type|
|Decimal||decimal||Decimal (15,2) older instances may have (12,2)|
8.2 Base System Fields
To see a list of default fields, use the following URL and substitute Incident for the desired table:
- These changes support developing scoped applications:
- Administrators can add fields only on tables that are in the same scope as the application selected in the application picker and tables that allow applications in another scope to add fields on them.
- When administrators add a field to a table belonging to another application, the field name is prefixed according to the scope of the table and the scope of the field.
- The new Composite field type combines two different types of information in one field; for example, a project number and short description. For more information, see Using Composite Fields.
- Mandatory fields on forms use an asterisk (*) to indicate field status. Field status indicators for modified and read-only fields have been removed.
- The Phone Number (E164) field type provides E164-compliant formatting and validation for telephone numbers.
- Administrators can create fields of the following types:
- Condition String
- Journal Input
- Journal List
- Password (1 Way Encrypted)
- Password (2 Way Encrypted)
- Script (Plain)