Survey123 Inbox Query Error

8174
11
Jump to solution
03-29-2018 05:45 AM
JoshHabel
Frequent Contributor

Hello,

I am getting the following error when I try to refresh my inbox. "Code 400 Cannot perform query.  Invalid query parameters."  I have double checked my query statement and it is okay.  The field names match perfectly and when I ran the query under the REST service it worked as well.  This does not make sense because it was working fine previously and then it stopped. The only thing that has really changed from when it was working is that i copied the survey to a new survey using the create new survey option.  Even still the query works when tested from the new Rest.  I have attached the xlsx file.  The form is setup so that when the inspector sets the Quick_Pick field to Set Return the survey will show up in his inbox.  My query is Quick_Pick = 'Set_Return'.  Any suggestions would be appreciated!

Josh

0 Kudos
1 Solution

Accepted Solutions
JamesTedrick
Esri Esteemed Contributor

Hi Josh,

You have one question in the XLSForm whose name has a hyphen in it (line 56) - this is causing the resulting table to not function correctly.  Substitute that with a underscore and republish.

View solution in original post

11 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Josh,

I'm seeing the same issue on a copy created by the Excel file you provided.  It's disallowing all where queries, not just the one you provided; you can see this if you add the layer to an ArcGIS Online Map.  In doing some testing, it seems that the list of fields being requested affects whether the query succeeds or not- I'm raising this with the ArcGIS Online team to see if there is a specific issue occurring here.

JamesTedrick
Esri Esteemed Contributor

Hi Josh,

You have one question in the XLSForm whose name has a hyphen in it (line 56) - this is causing the resulting table to not function correctly.  Substitute that with a underscore and republish.

JoshHabel
Frequent Contributor

James,

Removed the dash and that seems to have fixed it.  

Thanks!

0 Kudos
StephanieHickel
Occasional Contributor

Hey James,

I am having a similar issue. I have created two surveys with the same geodatabase. I enabled the inbox on the more in-depth survey and am getting the same error message as Josh: "Code 400 Cannot perform query. Invalid query parameters." I doubled checked my expression, survey_type="Initial Survey". All initial surveys will have an auto populated hidden attribute "Initial Survey." Is it possible some of my irregular characters in the hints column are throwing the query off? I don't have any dashes, but I do use parentheses. I attached the survey excel doc in the group (coastal_wetlands_investment_projects) for review.

Stephanie

0 Kudos
StephanieHickel
Occasional Contributor

Here is my Excel doc that is creating the query error.

Stephanie

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Stephanie,

This query is applied in the Inbox settings in Survey123, correct?  It looks like you should have survey_type='Initial Survey' (or possibly the code value if that is a field with a domain)- the difference between single quotes and double quotes matters in the query.

0 Kudos
StephanieHickel
Occasional Contributor

Hey James,

Yes the query is applied in my inbox settings in Survey 1,2,3. I changed my query to survey_type='Initial Survey' and am still getting the same error message, "Code 400 Cannot perform query. Invalid query parameters."

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Stephanie,

One way to work through the query setup is to go to the Service URL page of the layer and try out the query there, or get the query to successfully run in the map viewer (using developer tools to see the finished query).

0 Kudos
StephanieHickel
Occasional Contributor

Hey James,

I get the same error message when I delete the query expression. No results show up in my inbox and the same error code 400 message appears. Any idea what is causing this?

Stephanie

0 Kudos