Error Code 400 when trying to query by current date in inbox

2152
8
08-25-2017 11:06 AM
by Anonymous User
Not applicable

I have a survey that is completed by two parties.  The first part is filled in by a dispatcher through geoform, which then populates those fields in the survey.  The remainder of the survey is completed by a field technician.

I've enabled the Inbox mode and am trying to query by surveys from that day only.  

I'm using the expression schdate = CURRENT_DATE but when I try to refresh I get a Code 400 Cannot perform query. Invalid query parameters. Schdate is my Scheduled Inspection Date (date) field.

Is there something I am missing or some way I need to format this date?

Tags (2)
0 Kudos
8 Replies
JamesTedrick
Esri Esteemed Contributor
by Anonymous User
Not applicable

James,

That was the same issue but I got that one fixed.

I am having another one now.  I'm trying to figure out how to autocomplete a field based off user input.

I have two fields, section and zone.  I would like the section to be automatically selected based off of the users choice of zone.

I saw something similar for cities and states before but can't seem to find it again.  Any suggestions?

0 Kudos
MichaelKelly
Occasional Contributor III

Hi Brandon - what I think you're looking for is Cascading Selects. There is a sample form accessible through Survey123 Connect as below:

by Anonymous User
Not applicable

Michael,

So cascading selects is definitely part of what I need.

Is there a way to auto populate the "Section" field based off the Zone that is input?

For example, Zone R-1 is in Section Northeast.

I've got it laid out so that "Northeast" is the only option to select but is there a way that i can make it autocomplete?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Brandon,

Currently, Survey123 doesn't autofill when one choice is left after a cascade- we do this because 'no submission' may still be valid.

0 Kudos
AdamDaily
Occasional Contributor II

When attempting to refresh my inbox I am getting error Code 400, Searching for surveys: Cannot perform query. Invalid query parameters. 

I followed this example from the survey123 blog shown below, replacing only the words status (with my survey field name) and pending (with my desired result). I have a type username field in the survey as well (field is username). I tried removing my additional parameter and just going with assigned=${username} as my only parameter, but the same error msg appears when I publish and refresh my inbox. Any help on this would be appreciated.

 

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Adam,

I just attempted to replicate this with an Inbox survey I have and it worked correctly (in my case, the sql statement was 

Editor = ${username} and county = 'Montgomery' for http://services5.arcgis.com/jMCHJcLe13FaKCFB/arcgis/rest/services/Water_Stations_Test/FeatureServer/...  ). 

The most common issue for this type of error is that a field name is wrong - you may want to double-check the name (and possibly the capitalization) of the field name (not alias).

In terms of debugging, it's helpful to try out the query first at the 'Service URL' query page to make sure the query is valid. For my example, you would go to http://services5.arcgis.com/jMCHJcLe13FaKCFB/arcgis/rest/services/Water_Stations_Test/FeatureServer/... and in the 'Where' box place the sample query, substituting a real value for ${username}.  In my example, that would be Editor = 'jtedrick_Survey123' and county = 'Montgomery' .  It's also helpful to have a value of * in the Out Fields box to understand which records come back.

0 Kudos
AdamDaily
Occasional Contributor II

Thank you for the quick response. I’ve got it working now. Lots of little things to figure out but great app!

0 Kudos