Hidden Field Types: Month of Year

Now that we know about the existence of Hidden Field Types in Servicenow, it is time to inspect one of them: Month of Year

In this post, we will see how to create a new Month of Year field, how it looks in a form and some of its properties.

Creating a Month of Year field

The quickest way is to use the following URL (substitute <instance_name> by the name of the instance):

https://<instance_name>.service-now.com/sys_dictionary.do?sys_id=-1&sysparm_query=internal_type=month_of_year

It will open the form to create a new field with the Type already populated. You just need to select the Table and set the Column label and Column Name.

Month of Year: Dictionary Entry

Month of Year in a form

The new field is displayed as a select box.

Month of Year displayed in a Form

Values and Validation

Month of Year extends Integer.

Month of Year: Field class

It stores the number of the selected month.

Month of Year: Validation

These are the values for each of the options:

  • 1 = January
  • 2 = February
  • 3 = March
  • 4 = April
  • 5 = May
  • 6 = June
  • 7 = July
  • 8 = August
  • 9 = September
  • 10 = October
  • 11 = November
  • 12 = December

If we manipulate the value of the field, it will ignore all characters except for the digits between 1 and 12

Internationalisation

Month of Year field includes out of the box translations.

This is how it looks in Spanish:

Month of Year in Spanish

Service Portal

Unfortunately, the field type Month of Year is not displayed properly in Service Portal.

Month of Year: Service Portal