Skip to Main Content

While browsing through the depths of ServiceNow's out of the box modules you may have already stumbled upon fields on forms that do not look quite familiar. A good example of this would be the Template (template) field on the Template (sys_template) table. This particular field lets users choose field-value pairs depending on the table they have chosen in the Table (table) field on the same form. In fact, the underlying field type is called "Template Value" and is just one of many hidden field types in ServiceNow.

Field Type "Template Value"
Hidden Field Type "Template Value" Example on Template (sys_template) Table

Currently there are more than 50 field types visible in ServiceNow out of the box. You now probably wonder how to empower administrators to use the other ~100 hidden ones. First of all, lets check out how to find out which field types are actually in the system, both out of the box and hidden. The easiest and fastest way to do this is by navigating to the Field classes (sys_glide_object) list:

https://<instance_name>.service-now.com/sys_glide_object_list.do

 

Some of the field types you will find in that list are rather obscure and it can be hard to guess how and what they are actually used for, like "Tree Code" or "Insert Timestamp". Others are more self-explanatory like "JSON" or "Field List".  By taking a look into the Dictionary (sys_dictionary) table and filter by Type (internal_type) you can see where certain field types are used and take a closer look into these tables. For instance, to find all usages of the "Template Value" field type from our example above, you could navigate to:  

https://<instance_name>.service-now.com/sys_dictionary_list.do?sysparm_query=internal_type=template_value

 

Now that you know what field types are theoretically available you might consider giving your ServiceNow administrators the full power to rule them all.

 

Method #1: Removing the Reference Qualifier

The root cause why administrator can't choose any of the hidden field types is a Reference Qualifier on the Type (internal_type) field of the Dictionary (sys_dictionary) table. If you are not familiar with Reference Qualifiers and what they are used for, simply take a look into the Reference Qualifier section of ServiceNow's documentation. Removing this Reference Qualifier is a global change, meaning all field types will be choosable on all tables. To do so navigate to the Dictionary (sys_dictionary) list below and open one of the entries in the list:

https://<instance_name>.service-now.com/sys_dictionary_list.do

 

Right click the "Type" label and click "Configure Dictionary". In the "Reference Specification" tab set the "Use reference qualifier" to "Simple" and save. That's it! Alternatively you could also configure or write your own Dynamic Reference Qualifier in case you don't want to make the change globally.

 

Method #2: Changing the Field Type per Script

Changing ServiceNow's out of the box configuration might be scary and in case you only need the hidden field types very sporadically there is another way of changing the field type of a table column without making any drastic changes of the core system.

Simply create a new table column and set the field type to "String". Actually, you can set it to anything you want but "String" seems to be the most neutral choice. Get the sys_id of the column from the Dictionary (sys_dictionary) record you have just created.  

Get sys_id of Dictionary (sys_dictionary) record
Right click the form header and click "Copy sys_id"

Once you have the sys_id  it's time to decide which field type you would like to change the column to. Take a look at the field type list mentioned above and get the Name (name) of your field type of choice. Now let's execute some script magic:

var dictionary = new GlideRecord('sys_dictionary');
if(dictionary.get('<sys_id>')){
    dictionary.setValue('internal_type', '<name>');
    dictionary.update();
}

 

Replace the sys_id and name variables with your copied values and you are good to go. You can execute this script wherever server side scripting is possible: Background Scripts, Fix Scripts, Scheduled Jobs (On Demand)Xplore, ... After executing the script, check on the Dictionary (sys_dictionary) record if the field type has changed as desired. 

 

Method #3: Set the Field Type Visible

When viewing the list of field types mentioned above you might have already spotted the Visible (visible)  column on it. This boolean flag actually controls if this field type is available when creating a new field on a table. This also becomes clear when reading the tooltip on the Visible (visible) field which states: 

"Makes this field type available when adding new fields"

Unfortunately, security rules restrict us from simply editing this flag and we don't want to mess around with these. Similar to method #2 a small and simple script can help us out here. Get all the sys_ids of all the field types you want to become visible and insert them into below code (method #2 describes some locations where you can execute it):

var fieldTypes = new GlideRecord('sys_glide_object');
fieldTypes.addQuery('sys_id', 'IN', ['<sys_id_1>', '<sys_id_2>', '<sys_id_2>', '...']);
fieldTypes.setValue('visible', true);
fieldTypes.updateMultiple();