<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Download results as csv in Web Appbuilder in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/download-results-as-csv-in-web-appbuilder/m-p/765907#M1182</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Dec 2019 19:52:35 GMT</pubDate>
    <dc:creator>StephanieSaal2</dc:creator>
    <dc:date>2019-12-16T19:52:35Z</dc:date>
    <item>
      <title>Download results as csv in Web Appbuilder</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/download-results-as-csv-in-web-appbuilder/m-p/765907#M1182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2019 19:52:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/download-results-as-csv-in-web-appbuilder/m-p/765907#M1182</guid>
      <dc:creator>StephanieSaal2</dc:creator>
      <dc:date>2019-12-16T19:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Download results as csv in Web Appbuilder</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/download-results-as-csv-in-web-appbuilder/m-p/765908#M1183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stephanie,&lt;/P&gt;&lt;P&gt;You will most likely need to take the code from one of these two links and adapt it to your needs:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://code-maven.com/create-and-download-csv-with-javascript" title="https://code-maven.com/create-and-download-csv-with-javascript" rel="nofollow noopener noreferrer" target="_blank"&gt;Create and download data in CSV format using plain JavaScript&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://stackoverflow.com/questions/14964035/how-to-export-javascript-array-info-to-csv-on-client-side" title="https://stackoverflow.com/questions/14964035/how-to-export-javascript-array-info-to-csv-on-client-side" rel="nofollow noopener noreferrer" target="_blank"&gt;How to export JavaScript array info to csv (on client side)? - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; encodedUri &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;encodeURI&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;csvContent&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; link &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; document&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;createElement&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"a"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
link&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setAttribute&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"href"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; encodedUri&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
link&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setAttribute&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"download"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"my_data.csv"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
document&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;body&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;appendChild&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;link&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// Required for FF &lt;/SPAN&gt;
link&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;click&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// This will download the data file named "my_data.csv"&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:31:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/download-results-as-csv-in-web-appbuilder/m-p/765908#M1183</guid>
      <dc:creator>EricRuberson1</dc:creator>
      <dc:date>2021-12-12T08:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Download results as csv in Web Appbuilder</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/download-results-as-csv-in-web-appbuilder/m-p/765909#M1184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your recommendations. I'll give it a try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jan 2020 18:03:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/download-results-as-csv-in-web-appbuilder/m-p/765909#M1184</guid>
      <dc:creator>StephanieSaal2</dc:creator>
      <dc:date>2020-01-08T18:03:07Z</dc:date>
    </item>
  </channel>
</rss>

