Scripting of Field Types

From ServiceNow Wiki
Home > Script > General Scripting > Scripting of Field Types
Jump to: navigation, search
Note: This article applies to Fuji. For more current information, see Script Evaluation of Fields By Data Type at

The ServiceNow Wiki is no longer being updated. Please refer to for the latest product documentation.

Type Evaluates to in script Example
String The string.
"dog" > "dog"
Decimal A number with up to two decimal points
12.34 > 12.34
Integer A number with zero decimal points 12 > 12
True / False true or false

Image:Check_on.png > true

Image:check_off.png > false

Date A date formatted as yyyy-mm-dd
Date-time A day and time formatted as yyyy-mm-dd hh:mm:ss 2008-11-04 06:46:20
A date that is equal to January 1st 1970 00:00:00 + the amount of time of the duration being stored
Note: This date corresponds to the system time zone. If a different user time zone has been specified, the date and time value may appear different for that user.


> "1970-01-01 00:00:00"



> "1970-01-02 02:03:04"

Choice Returns the contents of the value field for the sys_choice record associated with that choice. See: Choice List for more information on returning the value associated with a particular item in a choice list.


> "2" (Note that this value is is a string)

Journal Returns a string of all entries made to that journal field. See Journal Fields for scripting of journal type fields
The web server is down > The web server is down
Reference Returns the sys_id of the record that is referenced

Reference.png >


Image Returns the path to the image

Image:imagefiletype.png > images/icons/image_name.gif

URL Returns a string Image:Url_example.png > ""
Glide Lists
Returns a string of comma-separated Sys IDs
Image:glidelist_example.png > 5137153cc611227c000bbd1bd8cd2007,46d14f04a9fe19810142e40c6b071512
Was this article helpful?
Yes, I found what I needed
No, I need more assistance