Hi, I'm building an app using the ArGIS Web Appbuilder. I'm using the Info Summary Widget to display features which can be filtered using the Filter Widget. I would like to add the option of downloading the filtered results as a csv. Optimally, this should just be a download button without having to go through the weeds like with the attribute table widget or screening widget. Any help is much appreciated.
You will most likely need to take the code from one of these two links and adapt it to your needs:
I've done some research on this issue recently and all of the solutions I came across were similar to the above. Basically all of the solutions come down to making a hidden link (an html 'a' element) that is empty but has a download attribute with your file name in it. Then the link clicks itself, which is what the below code does.
Essentially, you would have this code fire when your button is clicked. Caveat to my answer: I never got anything to work in internet explorer/edge.
var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
document.body.appendChild(link); // Required for FF
link.click(); // This will download the data file named "my_data.csv"