Select to view content in your preferred language

Limit the fields in Query Widget (Export to CSV)

2280
10
Jump to solution
04-04-2020 04:09 AM
KrishV
by
Frequent Contributor

Hi All,

I have seen Robert Scheitlin, GISP solution on below link and tried the same using WAB 2.15 but all the fields are getting downloaded in my csv.

Web App Builder - How to limit fields in "export to CSV" option in query widget? 

I have tried below code:

 var resultfields = [];
          
        for (i=0; i< popupInfos.length-1; i++){
            if (popupInfos[i].visible == true){
                resultfields.push(popupInfos[i].fieldName)
                
            }
            
        }
 var fFlds = array.filter(layer.fields, lang.hitch(this, function(fldInfo) {
   return  resultfields.indexOf(fldInfo.name) > 0;
;}));
             
var featureSet = new FeatureSet();
featureSet.fields = lang.clone(fFlds);‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Please help.

Thanks,

Krish

Tags (2)
0 Kudos
10 Replies
KevHofmann
New Contributor

Good afternoon.  This is probably an elementary question but I'm assuming this is a solution for the developer edition or can the code be modified in Enterprise 10.8.1 via the ArcGIS Online Assistant?

Thank you!

0 Kudos