Select to view content in your preferred language

WAB Export to CSV Disable X Y Columns

2984
14
04-12-2018 03:22 PM
ZlatinaGounev1
Emerging Contributor

Hi There,

By default when exporting an attribute table in a Portal App that has been created with WAB2.6  X,Y fields are generated automatically for point data:

Export to CSV—Exports the attributes to a CSV file. The X, Y coordinates are included for the point feature layer and keep the same spatial reference as the data regardless the map projection. If records are selected, only the selected records are exported. If no records are selected, all the records are exported. To support this function, the Export Data property must be enabled for the corresponding feature service.

How can this functionality be disabled. I would like to give the app users to download the data for analysis purposes but without getting the actual X,Y.

Thank you

Tags (1)
14 Replies
ZlatinaGounev
Emerging Contributor

So it seems GeoNet does not seems me as a full Author of my question so it is not enabling the "Mark Correct" option for me. 

I found some instructions on how to do it but I just don't get that "Mark Correct" button at all:

For any question in GeoNet  the group/space moderators and original posters have the option to mark a reply as correct. This will highlight the reply and bring it to the top of the Question. 

 

1. Open the Question to view the replies

 

2. Find the correct reply/answer

 

3. Click "Mark Correct"

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Zlatina,

   Are you logged in when you are trying to do this?

0 Kudos
LefterisKoumis
Frequent Contributor

I am using the WAB developer's 2.16. The AT even though the OBJECTID is set as "show":false and it doesn't display on the AT, it is still visible on the export csv.

I came across this posting, and under app#]\widgets\AttributeTable\table\_FeatureTable.js file

I commented out this line:

options.objectIds = !isSameProjection && this._getExportObjectIds();

But the OBJECTID field still shows up on the csv file. Suggestions?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

   For 2.16 make this edit to the CSVUtils.js file in the jimu.js folder (lines 14 - 16 added):

    exports._getExportData = function(layer, options) {
      var def = new Deferred();
      var _outFields = null;
      var _queryOutFields = [];
      var data = options.datas;
      var withGeometry = options.withGeometry;
      var withExpressionFields = !!options.arcadeExpressions;

      _outFields = options.outFields;
      if (!_outFields || !_outFields.length) {
        _outFields = layer.fields;
      }
      _outFields = lang.clone(_outFields);
      _outFields = _outFields.filter(function(fld){
        return fld.show
      });
...
0 Kudos
LefterisKoumis
Frequent Contributor

Thank you. It works.

0 Kudos