difference between general data types and ServiceNow field types?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 10:46 AM - edited ‎01-10-2024 10:51 AM
Question may seem fundamental or silly but need thoughts on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 01:55 PM
HI @KM SN ,
ServiceNow data type is mainly combo of database type and custom html type.
like in Database , integer, float , char , string , boolean where ServiceNow data types design to full fil db requirement along with form base needs.
like ServiceNow select box type ( html select ) is pointing to Question Choice table where the Label/Value are string ( txt ) type.
if u have any specific case or data type please share the details.
-Thanks
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 10:26 PM
Hi @KM SN ,
Several field types are available in the system.
Field types | Options | Dictionary XML type | MySQL DB type |
---|---|---|---|
String | small | string | VARCHAR(40) |
String | medium | string | VARCHAR(100) |
String | large | string | MEDIUMTEXT |
String | extralarge | string | MEDIUMTEXT |
Decimal | decimal | Decimal (15,2) older instances may have (12,2) | |
Integer | integer | Integer | |
True-False | boolean | TINYINT(1) | |
Date | glide_date | DATE | |
Date-Time | glide_date_time | DATETIME | |
Time | glide_time | DATETIME | |
Duration | glide_duration | DATETIME | |
Choice | string | VARCHAR(40) | |
Suggestion | string | VARCHAR(40) | |
Journal | journal | MEDIUMTEXT | |
Reference | <reference table> | reference | VARCHAR(32) |
List | glide_list | MEDIUMTEXT | |
Url | url | MEDIUMTEXT | |
Image | user_image | VARCHAR(40) | |
Due-Date | due_date | DATETIME |
- A string field defined in the platform with a max length of 40 characters → VARCHAR(40).
- A string field defined in the platform with a max length of x, where x = 41-255 characters, inclusive → VARCHAR(x) [examples: String 42 is VARCHAR(42) and String 211 is VARCHAR(211)].
- A string field defined in the platform with a max length of 256 and upwards → MEDIUMTEXT.
These field types are available to administrators when creating new fields or changing the type of existing fields.
Field Type | Description |
---|---|
Audio | Field for uploading and embedding .mp3 or .ogg audio files. |
Choice | List of configurable choices. |
Collection | Dictionary entries with the Collection type represent the table rather than a field on the table. Changes such as attributes or the Read only check box applied to this entry are applied to the table rather than a specific field. This entry is automatically created when a table is created. There should not be more than one entry for a table of this type. |
Color | String field that accepts CSS color declarations (including hex or RGB notation) and displays a preview. To learn more, see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value. |
Condition String | Text field that accepts a plain JavaScript condition statement that is validated automatically for correctness before an update. |
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 four digits after the decimal point. When displayed on a form, a currency field also includes an additional choice list for selecting the currency type. If there is no default value for the field, empty currency fields use the reference currency. Adding a value causes the field to use the session currency of the active user. See Change default currency decimal places for how to use two fraction digits.
Note: Once you assign this type to a field, you cannot change it to an FX Currency type.
|
Data Structure | Field that allows the selection of one of the following data structures and entry of values to organize particular information in the record.
|
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 record on any table. |
Domain ID | System field that contains a reference to the domain. |
Due Date | String input field that stores a date-time. |
Duration | Length of time. A time stamp stored in the database as date time. |
Encrypted Text | Field that is encrypted for security. Depending on the user's encryption module access, the field may be hidden, the value may be hidden, or the field and value may display. |
Field Name | Reference field for a field name in the table selected in a Table Name field type. Make this field dependent on the Table Name field. |
File Attachment | Field for holding a file. A field holds one file. All file types are supported. |
Floating Point Number | Number with up to seven digits after the decimal point. |
FX Currency | Also known in internal code as Currency2 fields, this field type is an alternative to the standard (default) currency fields found in most Now Platform® applications. This type of currency field is highly configurable, supports custom rate tables, report aggregations, and provides for improved visibility into conversion calculations. To learn more about the FX Currency field type, see Setting up and using FX Currency fields.
Note: Once you assign this type to a field, you cannot change it to an Currency type.
|
Geo Point | Field for holding longitude and latitude coordinates. |
HTML | String field with a built-in HTML editor. |
Icon | String field that provides the user access to an icon picker in a form. By default, the favorites icon set is used. |
Image | Field for uploading and embedding images. |
Integer | Number with zero decimal points.
Note: To search for an integer, input = followed by the integer in the search bar. For example, if you want to search for an Order of 100, input =100.
|
IP address | Variable character field that stores IPv4 and IPv6 addresses. See IP address field type for more information. |
Journal | Field that accepts text entries and displays previous entries with a user name and time stamp. |
Journal Input | Field that accepts text entries but does not display previous entries. |
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 depends on more than one journal field, the entries are displayed chronologically. |
List | Reference field that accepts multiple references rather than just one. |
Long | Integer field that can contain a longer number than the integer field. |
Name-Value Pairs |
Field that maps text values. Each mapping is one-to-one, however a single Name-Value Pairs field can contain multiple mappings. Each mapping must use a unique name, and the name cannot be empty. For example, you can use a Name-Value Pairs field to hold header information for a web service request. In this example, the name of each mapping is the header such as Content-Type and the value is the header value, such as Application/json. For information on scripting Name-Value Pairs fields, see Name-value pairs field type. |
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 Password2 encryption with KMF. The length for password2 field values must be at least 255 characters. |
Percent Complete | Decimal field that renders a percent complete bar in lists. You can convert any existing decimal field to a percent complete field. |
Phone Number (E164) | String field that provides E164-compliant formatting and validation for telephone numbers. |
Price | A currency field that enables control over conversions and display. See Price fields for more information. |
Reference | Query that displays records from another table. |
Script | Text field that accepts JavaScript code input and provides controls, such as syntax checking and formatting. It also provides a list of fields and server APIs. You must specify a dependent field that references the table name for the list of fields. |
Script (Plain) | Text field that accepts JavaScript code input and provides controls, such as syntax checking and formatting. |
String |
For 255 characters or less, the string field is a single-line text field. Anything 256 characters or over appears as a multi-line text box. Note: The database may translate the value that 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).
For Oracle instances, users are not able to increase the max length of a string field to a value greater than 4000 through the application UI. Changes greater than 4000 require the CLOB data type in Oracle. If you require a field to be larger than 4000 characters, log an incident to request the change. |
String (Full UTF-8) | String field that contains UTF-8 character encoding. This field type is restricted to the same maximum length that can be defined within the application UI as the String data type. Emojis are supported in the String (Full UTF-8) field type. |
Suggestion | String field that provides suggested values but accepts free-form text. Available when you add a field by configuring a form or list. Otherwise, you must modify the dictionary entry of an existing string or journal field. |
Sys ID | Field that contains a unique numerical identifier for each record. For more information about adding a Sys ID, see the following links:
Danger: Modifying or deleting a Sys ID results in bad or lost data.
|
Table Name | String field that lets you select a table. If you use the Field Name field type, add this field type and make the Field Name field dependent on the Table Name field. |
Time | Specific time. Stored in the database as a date/time field. Only the time part of this field is used.
Note: This field always stores the date as 1970-01-01, which does not fall within the dates for Daylight Savings Time (DST). As a result, the time is not automatically adjusted for DST. If a custom feature uses time as a start time, it is the responsibility of the feature to adjust for DST, if necessary.
|
Translated HTML | HTML field that displays different translations that are based on the user's language. |
Translated Text | Text field that displays different translations that are based on the user's language. |
True/False | Boolean field that appears as a one-digit integer, typically 1 (true) or 0 (false). |
URL | String field that is a clickable URL field when locked.
Note: In the mobile UI, this field appears as a multi-line text field. The field saves as a single line, with the line breaks removed.
|
Video | Field for uploading and embedding video. |
Wiki | String field with a built-in Wiki text editor that accepts a simplified version of standard Wiki text formatting. |
Workflow | Choice list field that displays a stage in a workflow. |