The Now Platform® Washington DC release is live. Watch now!
07-02-2019 11:28 PM
I am looking to add date range filter on my dashboard or homepage, it should let me pick specific FROM & To date and based on the date selection the charts (widgets) data should be changed.
e.g. 6th June, 2019 as From date & 16th June, 2019 as To date. Based on the date selection my charts should be able to reflect the data.
kindly let me know if you find anything in relation to the ask.
Solved! Go to Solution.
07-04-2019 12:37 AM
07-04-2019 12:37 AM
you could create your own custom interactive filter (Custom interactive filters ).
To give you a head start, please find attached an update set that will create
-a new widget type ("Custom Interactive Filters") in which you can list for which dates you want to have interactive filters
and
-a UI macro ("interactive_date_filter") that will generate the interactive filters as listed within the new widget type.
The result in the UI looks like this:
So like when in the condition builder, you can select:
-the date (A) to use in the filter,
-the operator (B) to apply,
-the operands (C) to set. The operands are of course dependent on the operator selected.
When developing or troubleshooting interactive filters, consider to add the "Debug homepage filters" (D) on your dashboard.
You could also have an interactive filter for which the date is fixed, so a user is not troubled by selecting the right date. It looks like:
Now, the user can only select the operator and operands.
To add the custom interactive filters to a dashboard when using the attached update set, it will look like this (with the responsive canvas plugin in Helsinki turned on):
So a new type/category of widgets (E), showing the dates as listed (F) in the new widget types.
In the new widget type ("Custom Interactive Filters"), you can list multiple dates for which you want interactive filters available in a 'condition builder' look and feel. It looks like this for the two interactive filters from screenshot above:
Thus
-give an interactive filter a name (1). This will show up on the widget;
-define the table (2). And if you want the user to be able to select for which date the filter should work (first screenshot), don't specify a field;
-define a specific field from the table (3) if you don't want the user to be able to select a date.
If you don't want every user to be able to add custom interactive filters to a dashboard, set the roles that should have access (4).
You can add more interactive filter dates to the list. For example:
resulting in:
Hope this helps.
09-09-2019 01:31 PM
@Christy Anusha,
Thank you for sharing this custom interactive filters. I encountered an issue when using Between and was wondering if you could shed some light on this. When I use the BETWEEN from the dropdown list the result showed " No data to display" . Did I do anything incorrectly? Your time and input are greatly appreciated.
10-21-2019 01:21 AM
Hi AlexW,
I think it happens because of your date/time format.
For example, I tried with the following queries:
From an incident list: opened_atBETWEENjavascript:gs.dateGenerate('2019-02-01','00:00:00')@javascript:gs.endOfToday()
From my dashboard using the intractive filter: opened_atBETWEENjavascript:gs.dateGenerate('01/02/2019','00:00:00')@javascript:gs.dateGenerate('21/10/2019','23:59:59')
You can see the difference betweeb the formats. What I quickly did, is change the code of the provided UI Macro interactive_date_filter. I modified the second argument of the GwtDateTimePicker() function: It was $[gs.getDatFormat()] and I hardcoded yyyy-MM-dd. And it now works fine!
These functions are cllaed on lines 82 and 91.
Hope this helps
02-05-2020 06:04 PM
Is it possible to have a default value for the Incident Open date filter? For example, I want to have last week as the default value so the loading time for data is reduced at the initial time.
you could create your own custom interactive filter (Custom interactive filters ).
To give you a head start, please find attached an update set that will create
-a new widget type ("Custom Interactive Filters") in which you can list for which dates you want to have interactive filters
and
-a UI macro ("interactive_date_filter") that will generate the interactive filters as listed within the new widget type.
The result in the UI looks like this:
So like when in the condition builder, you can select:
-the date (A) to use in the filter,
-the operator (B) to apply,
-the operands (C) to set. The operands are of course dependent on the operator selected.
When developing or troubleshooting interactive filters, consider to add the "Debug homepage filters" (D) on your dashboard.
You could also have an interactive filter for which the date is fixed, so a user is not troubled by selecting the right date. It looks like:
Now, the user can only select the operator and operands.
To add the custom interactive filters to a dashboard when using the attached update set, it will look like this (with the responsive canvas plugin in Helsinki turned on):
So a new type/category of widgets (E), showing the dates as listed (F) in the new widget types.
In the new widget type ("Custom Interactive Filters"), you can list multiple dates for which you want interactive filters available in a 'condition builder' look and feel. It looks like this for the two interactive filters from screenshot above:
Thus
-give an interactive filter a name (1). This will show up on the widget;
-define the table (2). And if you want the user to be able to select for which date the filter should work (first screenshot), don't specify a field;
-define a specific field from the table (3) if you don't want the user to be able to select a date.
If you don't want every user to be able to add custom interactive filters to a dashboard, set the roles that should have access (4).
You can add more interactive filter dates to the list. For example:
resulting in:
Hope this helps.