Query Failed with AGOL WAB

04-09-2018 10:43 PM
New Contributor III


I'm running into a query failed error with the AGOL Query widget. I'm trying to do an intersect between a feature layer and an external map service hosted outside of the organisation. 

The thing that perplexes me the most is that it was working as of yesterday when I first tested it but I couldn't get it to work now.

Here is the console view of the error.

Tags (2)
0 Kudos
2 Replies
MVP Emeritus


   None of those error help at all unless we can see the corresponding lines of code in your Widget.js. Since you are querying a Map Service on another server do you have a proxy setup?

0 Kudos
New Contributor III

Hi Robert,

I do have a proxy setup but I tested the widget outside of the organisation and it still doesn't work. It does however work on some map service layers.

The code died at :

doQuery_SupportOrderByAndPagination: function(a, b) {
var e = new f
, c = n.hitch(this, function(a) {
console.error(a); --------------------> CODE DIED HERE
, d = this.currentAttrs.query.relationship;
this._queryCount(a, b, d).then(n.hitch(this, function(k) {
this.currentAttrs.query.allCount = k;
0 === k ? e.resolve([]) : (this.currentAttrs.query.nextIndex = 0,
this._queryWithPaginationAndOrder(a, b, 0, this.currentAttrs.query.maxRecordCount, d).then(n.hitch(this, function(a) {
a = a.features;
this.currentAttrs.query.nextIndex += a.length;
}), c))
}), c);
return e

Through Fiddler, I notice that it failed at the query request on the Feature Layer and not the Map Service layer with a code":400,message -Unable to perform query. Please check your parameters.

Not sure what is causing the issue, perhaps a dodgy syntax?

I was able replicate the exact same error by doing a Select By Location on ArcGIS Pro using those two layers. Just to clarify, the feature layer sits within AGOL whilst the map service sits in an external organisation. I've built the the query using the standard Query widget with date inputs by users and a spatial relationship intersect with a map service hosted externally.The feature layer is quite large with about 1 million polygons.

****************UPDATE : Potentially Size Related *************

I adjusted the date queried so that it returns a smaller result and I was able to obtain a result from that. So, it seems to me that something is falling over due to the large feature layer queried.

****************UPDATE: Temporary Workaround******************

I did manage to find a workaround and it involves creating two Query widgets , the first one would create a query of the first feature layer and then the second one would intersect the results of the first layer to return the results required.  That worked fine but it's not something I was hoping I would resort to.