Select to view content in your preferred language

Disable all Export data actions at once

639
5
03-14-2024 04:40 AM
Status: Open
Labels (2)
Thomas1
Frequent Contributor

In Experience Builder, disabling the Export data action is done on the data source. This has to be done on every single layer. It is great to have the possibility to "fine-tune" and choose for every single layer but itis nonsense that it is not possible to disable all export at once in an app.

5 Comments
Ashley_Snyder

In addition to being able to do a disable export data en mass, it would also be helpful to have to option to toggle Export on and off in the data action section of widgets.

DanCopKac

lol ive spent days in company paid time navigating through each layer and turning them off one by one

DanCopKac

@Thomas1 

I found a solution! I tweaked the boolean so that all data sources default to disallow export, but the setting can still be manually changed.

If you are on Developer Edition and suffering from the same problem as me, you can follow these steps:

In the installation folder navigate to the following file

client\dist\jimu-core\data-source.js

find the line 

return r?r.allowToExportData():(console.error("Origin data source is not created, allow to export data by default. Output data source id is ",this.id),Promise.resolve(!0))}return!this.getDataSourceJson().disableExport

change it to

return r?r.allowToExportData():(console.error("Origin data source is not created, allow to export data by default. Output data source id is ",this.id),Promise.resolve(!0))}return this.getDataSourceJson().disableExport

Now all layers will default to not allow export when the config.json value disableExport is not yet set. Note that anyone looking in the config.json will get confused because this flag will no longer make sense.  

Additionally, this creates chaos in the builder because the toggle in the data panel still says "Allow export". So I went ahead and changed this text to "Disable export" as well so the toggle button makes more sense. 

That can be done by following these steps: 

Navigate to 

Client\dist\builder\widgets\data-source-setting\dist\runtime\widget.js

change 

allowExport:"Allow export",

to 

allowExport:"Disable export",

 

Now you don't have to spend hours or days wading through the data panel to disable exports for each of your layers one by one!

DanCopKac

@Thomas1 

I found my own solution! I tweaked the boolean so that all data sources default to disallow export, but the setting can still be manually changed. https://community.esri.com/t5/arcgis-experience-builder-questions/allow-export-for-all-layers/m-p/15...

TimWestern

I wonder if you could make a custom widget (or perhaps only in settings) that would disable all the export, and then let you pick one layer to enable?