Creating Feature Report: cannot perform query. Invalid query parameters

2482
7
Jump to solution
02-05-2020 01:13 AM
MervynLotter
Regular Contributor

Hi there

Last year I created a report template which I uploaded to https://survey123.arcgis.com/surveys  and everything was working perfectly. I could share the reports to others. Thereafter, I recall also creating a hosted layer view of the feature service in AGOL. Dont think I made any other changes. 

Unfortunately this year I am unable to generate any reports. I get the error message "Error occurred when querying data from the feature layer. Cannot perform query. Invalid query parameters."  after clicking on the "generate" report button, or viewing the sample report.

At first I thought this may be related to any permissions being changed on the layer in AGOL, but I don't think so. 

I even tried downloading a sample report from Survey123 (under Mange Templates) for my dataset but that also does not work.

Any suggestions as to where my problem may lie? 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ZhifangWang
Esri Regular Contributor

Hi Mervyn,

Thank you for the information.

According to your description, I can confirm this is the bug I mentioned in 3.8 release. We already planned a hotfix to address this in a few days, will let you know once it's released. In the meantime, you can use the workaround (manually sort any field in the table first) to generate a report as needed, the result will be the same after the hotfix.

For the Overview page, since the underlying feature service does not have an edit date field from editor tracking, what you see is a by-design behavior for now because that we cannot extract related info if there is no creator, creation date, edit date fields. If you have any use case or question (for example, regardless of editor tracking fields, you do have equivalent fields by your own design), please don't hesitate to let us know.

Thanks,

Zhifang

View solution in original post

0 Kudos
7 Replies
ZhifangWang
Esri Regular Contributor

Hi Mervyn Lotter ,

Would you mind sharing

  • when is the first time you saw this issue?
  • before this issue, did you make any change to your survey or the template recently?

We have identified a bug after the recent 3.8 release on 1/22, which will raise the exactly same error message as you mentioned. Below are the conditions to reproduce the bug:

  • The survey is created from an existing feature service (seems this is qualified for your survey)
  • The underlying feature layer has not enabled owner based access control (OBAC) or it does not have the edit date field (which records the last edit time of the feature).
  • Before previewing or generating the report, you didn't manually sort any field in the feature table of the Data tab.

Can you please check if this is what you encountered? Note: if you can work around this error by just manually sort any field in the feature table (no matter ASC or DESC) before previewing or generating the report, then you should hit this bug.

Thanks,

Zhifang

MervynLotter
Regular Contributor

Hi Zhifang

Thank you for your email. The good news is that sorting the records does allow me to create my reports.

  • I first observed this error on the 28 January 2020.
  • I made changes to it in December, but to the hosted feature layer in AGOL. It would be related to layer views and permissions.
  • I created the original feature service in Survey123 Connect. I then later 'opened' the feature service in AGOL as described above. 
  • I do have web-hooks attached to the survey to notify me when  survey is being submitted. 
  • I cant find the edit date field in the feature service.
  • I had not sorted the data by any field before trying to generate the report.

Interestingly, when i now look at the Overview tab in www.survey123.arcgis.com, then under Surveys Submitted, it now says "This feature is not available. The creator field cannot be found in the feature service."

0 Kudos
ZhifangWang
Esri Regular Contributor

Hi Mervyn,

Thank you for the information.

According to your description, I can confirm this is the bug I mentioned in 3.8 release. We already planned a hotfix to address this in a few days, will let you know once it's released. In the meantime, you can use the workaround (manually sort any field in the table first) to generate a report as needed, the result will be the same after the hotfix.

For the Overview page, since the underlying feature service does not have an edit date field from editor tracking, what you see is a by-design behavior for now because that we cannot extract related info if there is no creator, creation date, edit date fields. If you have any use case or question (for example, regardless of editor tracking fields, you do have equivalent fields by your own design), please don't hesitate to let us know.

Thanks,

Zhifang

0 Kudos
ZhifangWang
Esri Regular Contributor

Hi Mervyn,

We fix to this issue is now available on the Survey123 website, you should be able to generate the report without doing any additional steps.

Thanks,

Zhifang

MervynLotter
Regular Contributor

Hi Zhifang

Works like a charm once again. Thanks so much!

Cheers

Mervyn

0 Kudos
cmpalmer
New Contributor

I'm also having this issue.  When trying to upload a Report template, I get the error: "Error: An error occurred when querying data from the feature layer. An error occurred when querying data from the feature layer. 400: Cannot perform query. Invalid query parameters."  

20201210_CSJShelterBuildingSurvey_Error_ManageTemplates.png

Tracing the network call, the call is failing on this parameter:  "queryParameters":{"orderByFields":"||EditDate_2 DESC, OBJECTID ASC","objectIds":"43"}  I am wondering if possibly the "||" in the query parameters is causing the error?  The report template that I'm trying to upload is very basic with no complicated syntax, for testing purposes:

20201210_Building_template_test.png

From the advice in this thread, I manually sorted a column in the survey table before uploading the report template, but I am still getting the same error.  The survey was published with version 3.10.  Any advice is greatly appreciated! Thanks.

0 Kudos
DiegoLlamasOlivares
New Contributor III

Hello,

 

I had the same error,

 

check that you do not have any field with dash -

i create a survey using connect and use dash and publish

DiegoLlamasOlivares_0-1627584509538.png

then i change the dash (-) for underscore (_) and republish

DiegoLlamasOlivares_1-1627584554509.png

 but in hosted feature the field was there, so I delete the fields that had dash (-) and then it worked.

 

hope this help.

DLL

 

 

0 Kudos