AnsweredAssumed Answered

Can't export Query result to CSV

Question asked by simo Champion on Jun 18, 2019
Latest reply on Jun 20, 2019 by simo

I tried this in both WAB Portal version and Developer Edit, and he result seems the same. Here is what's shown in the Chrome console:



Further investigation reveals that the cause is the projection of the query result (wkid: 4326 in my case) is not the same as the map projection (wkid:102100).


In the code (exportToCSV function in _FeatureTable.js), it says:


            var isSameProjection = this.layer.fullExtent.spatialReference.equals(

            var hasArcadeExpressionFields = this._hasArcadeExpressionFields();

            // if the output layer's spatial reference is the same as map's, which means
            // a spatial reference conversion to make output data (X, Y fileds) consistent with
            //layer's original projection system is NOT needed. then we can use data from client side.
            // if they are different, then it needs to send a query request to
            // server side (handle by "_getExportDataFromServer" method in jimu/CSVUtils.js)
            // to get the data with correct spatial reference
            if(isSameProjection) {
              var rows =
                lang.hitch(this, function(id) {
                  for (var i = 0, len = datas.length; i < len; i++) {
                    if (datas[i] && datas[i][oid] === id) {
                      return datas[i];
                  return {};
              var _selectedData = rows || [];// get selected data
              // if table were in selection mode and no records were selected, we push an
              // empty object to _selectedData, for the following logic compatible.
              if(_selectedData.length === 0 && this.isSelectionMode()){

              _exportData = _selectedData;

              if(_selectedData.length === 0 && instanceof Memory){
                _exportData = lang.clone(;




If I force isSameProject to equal to "true", it will work.

But,  will that have any side-effects to other parts of my applicaiton? is it a Query widget bug or AttributeTable widget bug? My data and my map are both in 102100 projection, I have no idea where the 4326 spatial reference comes from.