Dashboard Date Selector Error Filtering List and Map

356
3
05-27-2021 04:34 PM
AndreaJacobs
New Contributor II

I've noticed on a dashboard that the date selector using Relative Date is returning different results for the same data layer on our map element and list tile. Both are referencing the same layer from the map and using the same field to filter, dates are in UTC, data is from an ArcGIS Server map service published with dates as UTC. The dashboard was made using the Classic Map Viewer, although I tried using the new Map Viewer and saw the same behavior. I haven't been able to find anyone else having this issue or any bug mentioned. Happy to supply additional information if requested but the data is not something I can share outside of our org.  Does anyone have thoughts on where we could be going wrong? 

3 Replies
jcarlson
MVP Notable Contributor

Could you export a subset with sensitive fields removed?

Or could you copy out the item JSON? You can do it with either version of the AGO Assistant tool.

https://assistant.esri-ps.com/

https://ago-assistant.esri.com/

You should be able to find a section that gives the date selector details and its associated triggers.

... 
           {
                "type": "dateSelectorWidget",
                "optionType": "definedOptions",
                "definedOptions": {
                    "type": "definedOptions",
                    "displayType": "button_bar",
                    "defaultSelection": "first",
                    "noneLabelPlacement": "last",
                    "noneLabel": "All Logs",
                    "namedFilters": [
                        {
                            "displayName": "1D",
                            "filter": {
                                "type": "filterGroup",
                                "condition": "OR",
                                "rules": [
                                    {
                                        "type": "filterGroup",
                                        "condition": "AND",
                                        "rules": [
                                            {
                                                "type": "filterRule",
                                                "field": {
                                                    "name": "filterField",
                                                    "type": "esriFieldTypeDate"
                                                },
....

 

- Josh Carlson
Kendall County GIS
AndreaJacobs
New Contributor II

The date selector JSON is below. The one thing standing out to me right now is that our type is just date, not esriFieldTypeDate. I wonder if that could be it?

"type": "dateSelectorWidget",
                "optionType": "definedOptions",
                "definedOptions": {
                    "type": "definedOptions",
                    "displayType": "button_bar",
                    "defaultSelection": "last",
                    "noneLabelPlacement": "last",
                    "allowNone": true,
                    "noneLabel": "ALL",
                    "namedFilters": [
                        {
                            "displayName": "Hour",
                            "filter": {
                                "type": "filterGroup",
                                "condition": "OR",
                                "rules": [
                                    {
                                        "type": "filterGroup",
                                        "condition": "AND",
                                        "rules": [
                                            {
                                                "type": "filterRule",
                                                "field": {
                                                    "name": "filterField",
                                                    "type": "date"
                                                },
                                                "operator": "is_within_last",
                                                "constraint": {
                                                    "type": "relativeDate",
                                                    "unit": "h",
                                                    "value": 1
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        },
                        {
                            "displayName": "12 hours",
                            "filter": {
                                "type": "filterGroup",
                                "condition": "OR",
                                "rules": [
                                    {
                                        "type": "filterGroup",
                                        "condition": "AND",
                                        "rules": [
                                            {
                                                "type": "filterRule",
                                                "field": {
                                                    "name": "filterField",
                                                    "type": "date"
                                                },
                                                "operator": "is_within_last",
                                                "constraint": {
                                                    "type": "relativeDate",
                                                    "unit": "h",
                                                    "value": 12
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        },
                        {
                            "displayName": "24 hours",
                            "filter": {
                                "type": "filterGroup",
                                "condition": "OR",
                                "rules": [
                                    {
                                        "type": "filterGroup",
                                        "condition": "AND",
                                        "rules": [
                                            {
                                                "type": "filterRule",
                                                "field": {
                                                    "name": "filterField",
                                                    "type": "date"
                                                },
                                                "operator": "is_within_last",
                                                "constraint": {
                                                    "type": "relativeDate",
                                                    "unit": "h",
                                                    "value": 24
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        },
                        {
                            "displayName": "7 days",
                            "filter": {
                                "type": "filterGroup",
                                "condition": "OR",
                                "rules": [
                                    {
                                        "type": "filterGroup",
                                        "condition": "AND",
                                        "rules": [
                                            {
                                                "type": "filterRule",
                                                "field": {
                                                    "name": "filterField",
                                                    "type": "date"
                                                },
                                                "operator": "is_within_last",
                                                "constraint": {
                                                    "type": "relativeDate",
                                                    "unit": "d",
                                                    "value": 7
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        },
                        {
                            "displayName": "28 days",
                            "filter": {
                                "type": "filterGroup",
                                "condition": "OR",
                                "rules": [
                                    {
                                        "type": "filterGroup",
                                        "condition": "AND",
                                        "rules": [
                                            {
                                                "type": "filterRule",
                                                "field": {
                                                    "name": "filterField",
                                                    "type": "date"
                                                },
                                                "operator": "is_within_last",
                                                "constraint": {
                                                    "type": "relativeDate",
                                                    "unit": "d",
                                                    "value": 28
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }
                        },
                        {
                            "displayName": "YTD",
                            "filter": {
                                "type": "filterGroup",
                                "condition": "OR",
                                "rules": [
                                    {
                                        "type": "filterGroup",
                                        "condition": "AND",
                                        "rules": [
                                            {
                                                "type": "filterRule",
                                                "field": {
                                                    "name": "filterField",
                                                    "type": "date"
                                                },
                                                "operator": "is_on",
                                                "constraint": {
                                                    "type": "period",
                                                    "value": "thisYear"
                                                }
                                            }
                                        ]
                                    }
                                ]
                            }

 

jcarlson
MVP Notable Contributor

Hard to say, but I think that's something worth investigating. Where is the data coming from? Based on the field type, I'm guessing it's not a hosted layer?

To see if that's the determining factor, you might try publishing a subset of the layer as a hosted feature layer, add that hosted subset to the dashboard, and see if the date filter behaves any differently there.

- Josh Carlson
Kendall County GIS