ArcGIS Online - using the Query widget for Date queries

9663
15
Jump to solution
02-17-2015 01:38 AM
Cormaclacey
New Contributor II

Hi

 

I'm trying to set up a date query using the Query widget in a Web AppBuilder app but the query doesn't return any results...can't figure out why. I get a message saying 'query failed!' and 'number of features found: 0', when there should definitely be some results returned.

 

So far I've checked/ tried a few things:

  • The layer I'm using has time enabled
  • Filtering by date works fine within the web map
  • When setting the query up within the Query widget it recognises that the field I'm using is in Date format because it lets me set the default to search between two dates
  • When I look at the attribute table in the app it sorts the date field correctly

 

Any suggestions for other things I can try?

 

Thanks for your help!

Tags (2)
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Cormac,

   You are running into an issue with the query widgets SQL statement being formed using 'timestamp' when it should not be. I have seen others report this issue and it seem to normally happen when people are using a featureLayer from AGOL for their query. This is some thing you need to call esri tech support about to make sure there is already a bug logged for this.

This is the query that the query widget sends:

http://services.arcgis.com/tnTLtmrGqbVBqigz/arcgis/rest/services/AGOL_Date_Test_WGS84.gdb/FeatureSer...

this is what it should be sending:

http://services.arcgis.com/tnTLtmrGqbVBqigz/arcgis/rest/services/AGOL_Date_Test_WGS84.gdb/FeatureSer...

View solution in original post

15 Replies
LisaTurner
Occasional Contributor II

Hey Cormac,

You might want to move this question into Web AppBuilder for ArcGIS so it is seen by the widget group.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Cormac,

   I have setup the query widget using time enabled layers and not had any issue.

  1. Is there any other details on your setup you can provide?
  2. Is your service public where I can test it?
  3. What is the underlying database that the service comes from (oracle, sql server, etc)?
  4. Is the service coming from AGOL web map or a ArcGIS Server service?
0 Kudos
Cormaclacey
New Contributor II

Lisa, Robert - thanks for your replies.

I can't make the service public unfortunately because the data is sensitive, but I'm going to try with a different 'test' layer tomorrow and see if I get the same problems.

The only other information I can give is that the service is hosted on AGOL using Feature Layers that have been uploaded to the AGOL server - so there is nothing held outside of AGOL.

Any other suggestions on what I can try would be appreciated, I'll try posting on the Web AppBuilder forum tomorrow if I'm not having any more luck.

Thanks again

0 Kudos
Cormaclacey
New Contributor II

I've now tried with a test file and am getting the same error message...must be something in the way I've set up the query?

I've made the test app public - link below - if you are able to have a quick look and see if you can spot what the problem is I'd really appreciate it.

ArcGIS Web Application

Thanks again

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Cormac,

   You are running into an issue with the query widgets SQL statement being formed using 'timestamp' when it should not be. I have seen others report this issue and it seem to normally happen when people are using a featureLayer from AGOL for their query. This is some thing you need to call esri tech support about to make sure there is already a bug logged for this.

This is the query that the query widget sends:

http://services.arcgis.com/tnTLtmrGqbVBqigz/arcgis/rest/services/AGOL_Date_Test_WGS84.gdb/FeatureSer...

this is what it should be sending:

http://services.arcgis.com/tnTLtmrGqbVBqigz/arcgis/rest/services/AGOL_Date_Test_WGS84.gdb/FeatureSer...

RobertScheitlin__GISP
MVP Emeritus

Here is another thread showing the same issue:

Re: How do you get a date query to work?

Cormaclacey
New Contributor II

Robert - thanks for your help with this, I've reported the issue as a bug so hopefully someone at ESRI will have a look at it. In the meantime I'll set up a dummy date field using integers so users can still search by 'date'.

thanks again

0 Kudos
SubuSwaminathan1
Occasional Contributor

Can you provide the bug number? I would like to follow the bug and push up its priority  with esri?

Thank you,

Subu

0 Kudos
KirkHarstead
New Contributor III

I don't know if you've found this yet Subu, but the Bug number is: BUG-000084034 BUG-000084034 - Using the Query widget on date fields in Web AppBu..

The page says that the status is "Closed:Fixed", but I am still having this problem with querying on a date field. Are you still experiencing this problem?