Is it possible to group by month on a list view?

Community Alums
Not applicable

We're building a new application and one of the functional requirements asks for the ability to view a list view, grouped by date.   But the grouping needs to be by month.   This doesn't appear possible out of box.   Has anybody managed to implement such a feature?   If so, how did you solve it?

We know similar functionality is possible via reports, but we need to research if a list view can be modified to do this.

6 REPLIES 6

Ankit K
ServiceNow Employee
ServiceNow Employee

Hi Steve,



Just to add to what you mentioned, when the new custom field is added to the table the data type of the field could be used as Date Integer instead of Date/Time . Then we can dynamically populate this field using the "javascript:gs.nowDateTime()" call.


This field can then be 'group by' in the list view. But yes we would still need to define what date-range constitutes a quarter otherwise every value would be unique and it would bring up every record as it would have a unique timestamp.



I don't believe we can group by on the Date/Time datatype which is the default type on our "sys_created_on" and other such date-time range fields.


Ankit,   you have a very good point.   One must use a type-of-field that can be grouped to meet these requirements.


I'm not familiar with the Date Integer type, but I bet it would work great.


While I didn't explicitly say it in my previous post, I would use a string type field and populate it with the year and month from the Display Value of the date.


I think your advice is a more compact solution though.   Does Date Integer carry the number of seconds from 1970 ( which I believe is the internal storage format).


If this is the case, then real date/time, will need to be adjusted to a specific day of the month and time, say the 1st of the month at 12:00 noon.   That will allow grouping by month.