Failed Query from Joined View with Query Widget

4072
23
10-26-2015 09:07 AM
MarieCline_Delgado
Occasional Contributor

I have a view joined with a feature class (one-to-one).  I have set up a query/filter in the Web App builder from the feature class to search the joined view data but the query fails. 

What reasons could cause this query to fail?  Can I query joined data? 

Thank you!

0 Kudos
23 Replies
JakeSkinner
Esri Esteemed Contributor

If you use the Web AppBuilder (Developer Edition) and host the web application on a web server, you can edit the Query widget to take into account the missing quotes.  For example, in the Widjet.js file of the Query widget, you can make the update around line 572:

if(this.currentAttrs.askForValues){
  var newExpr = this.paramsDijit.getFilterExpr();
  var update = '"' + newExpr.split(" ")[0] + '"';
  newExpr = update + newExpr.split(" ")[1] + newExpr.split(" ")[2]

The query you are trying to execute should then work.

JakeSkinner
Esri Esteemed Contributor

Hi Marie,

I ran into a similar issue working with a customer.  They were trying to query a feature class joined to a CSV file.  A bug was logged for this issue:  BUG-000089185.

The issue is the query required quotes around the field name to execute successfully.

Example:  "<FileName.csv.<FieldName>" > 500000

This caused the Query widget in Web AppBuilder to fail since the request is sent w/o the quotes around the field name.

I would try querying the service in the REST directory to see if it too requires quotes.

JakeSkinner
Esri Esteemed Contributor

I just ran a quick test with a view joined to a feature class, and it appears to be the same bug.  When querying with the following:

VECTOR.VECTOR.%MODIV_VCS.BlockLotQ = '83-14-'

I receive an error.  However, the below worked w/o error:

"VECTOR.VECTOR.%MODIV_VCS.BlockLotQ" = '83-14-'

I would recommend contacting Tech Support to have them add your customer information to this bug and let them know this is an issue for database views as well.

0 Kudos
MarieCline_Delgado
Occasional Contributor

Thanks for the help, Jake.

I wanted to show you how I have the query set up.  If you see anything I could do different to make this work, I would appreciate any feedback.  I have contacted Tech Support and asked to be added to the bug.  Thanks for all your help!

0 Kudos