Create Custom Date filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello Experts,
We have a business requirement to create a new date filter option similar to 'Quarterly'. Our customer works in a period of 4 months frequency (Quadrimestral), they have 3 periods in each year.
So, the ask is to collect and visualize data w.r.t. this frequency instead of what ServiceNow provides OOB.
We want to use conditions in indicator sources like Created on This Quadrimestral or Created on Last Quadrimestral. And similarly the visualizations on the widgets also should be displayed corresponding to this period.
Would like to know if this is achievable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Kuldeep Kumavat ,
I read your requirnment also refered some threads.
I created dynamic filter (all=>dynamic filter option.do)
here selected referenced table as user to get this filter in is(dymaic) operator value.
script include :
function getQuadrimesterRange() {
var now = new GlideDateTime();
var month = parseInt(now.getMonthLocalTime()) + 1;
gs.log(month)
var quadStartMonth = Math.floor((month - 1) / 4) * 4 + 1;
var startDate = new GlideDateTime();
startDate.setMonthLocalTime(quadStartMonth - 1);
startDate.setDayOfMonthLocalTime(1);
startDate.setHourLocalTime(0);
startDate.setMinuteLocalTime(0);
startDate.setSecondLocalTime(0);
var endDate = new GlideDateTime(startDate);
endDate.addMonths(4);
endDate.addSeconds(-1);
return startDate.getValue() + "@" + endDate.getValue();
}
But here getting one isuue for this filter is(dynamic) is not available for created/updated field.
But when i select caller is(dynamic) filter getting this custom filter This quadrimetal Data
I’m not sure why this is happening. The custom dynamic filter is not available for the Created or Updated fields. However, the data is filtering correctly as per the requirement when I apply Caller is (dynamic) This Quadrimester Data 🙂 .
If you have to use that only for reporting i think this is fine but logically condition should be created on this Quadrimester Data but its working for condition like caller is(dynamic) this Quadrimester Data
If this helps you then mark it as helpful and accept as solution.
Regards,
Aditya,
Technical Consultant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Kuldeep Kumavat ,
I refered following threads you can also refer this :
https://www.servicenow.com/community/developer-articles/create-your-own-dynamic-filters/ta-p/2321052
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @Kuldeep Kumavat ,
I hope you are doing well . Does my response helps you ?
If my response helps you then mark it as helpful and accept as solution
Regards,
Aditya ,
Technical Consultant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Kuldeep,
Yeah I think you can do this by going to business_calendar_group table and getting set up from there.
I'd use "gregorian calendar" as a template for configuring your quadrimestral (what a word :D) cycles.
https://www.servicenow.com/docs/r/platform-administration/time-configuration/create-business-calenda...

