<?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 Esri JS API Export to SHP using ExtractData in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-export-to-shp-using-extractdata/m-p/1326147#M82178</link>
    <description>&lt;P&gt;I want to export features to shapefile by calling the following rest service:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;arcgis/rest/services/System/SpatialAnalysisTools/GPServer/ExtractData/execute&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to documentation:&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/analysis/api-reference/extract-data.htm" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/rest/analysis/api-reference/extract-data.htm&lt;/A&gt;&amp;nbsp;the required parameter is "inputLayers" which can be either URL reference or FeatureSet.&lt;/P&gt;&lt;P&gt;First I tried URL reference as inputLayers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;[{"url":"url","serviceToken":"token","filter":"objectid = 109002"}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;and received an error:&amp;nbsp;&lt;STRONG&gt;"Error executing tool. ExtractData : {\"messageCode\": \"AO_100289\", \"message\": \"Environment connection error. Contact Esri Support Services.\"}&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So now I tried to send FeatureSet. I don't know how to create one from scratch so i used layer.queryFeatures which should return FeatureSet:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;const &lt;/SPAN&gt;query = {&lt;BR /&gt;    &lt;SPAN&gt;where&lt;/SPAN&gt;: "objectid = 109002"&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;outFields&lt;/SPAN&gt;: [&lt;SPAN&gt;"*"&lt;/SPAN&gt;]&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;returnGeometry&lt;/SPAN&gt;: &lt;SPAN&gt;true&lt;BR /&gt;&lt;/SPAN&gt;}&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;layer.&lt;SPAN&gt;queryFeatures&lt;/SPAN&gt;(query)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Sending the result to ExtractData results in following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;STRONG&gt;Invalid value for parameter inputLayers - Details :&lt;/STRONG&gt; "&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also tried creating featureCollection with the same error as above.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to properly use ExtractData service or maybe there is an easier way to export data do shapefile?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2023 21:35:21 GMT</pubDate>
    <dc:creator>patryks</dc:creator>
    <dc:date>2023-09-06T21:35:21Z</dc:date>
    <item>
      <title>Esri JS API Export to SHP using ExtractData</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-export-to-shp-using-extractdata/m-p/1326147#M82178</link>
      <description>&lt;P&gt;I want to export features to shapefile by calling the following rest service:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;arcgis/rest/services/System/SpatialAnalysisTools/GPServer/ExtractData/execute&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;According to documentation:&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/analysis/api-reference/extract-data.htm" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/rest/analysis/api-reference/extract-data.htm&lt;/A&gt;&amp;nbsp;the required parameter is "inputLayers" which can be either URL reference or FeatureSet.&lt;/P&gt;&lt;P&gt;First I tried URL reference as inputLayers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;[{"url":"url","serviceToken":"token","filter":"objectid = 109002"}]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;and received an error:&amp;nbsp;&lt;STRONG&gt;"Error executing tool. ExtractData : {\"messageCode\": \"AO_100289\", \"message\": \"Environment connection error. Contact Esri Support Services.\"}&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So now I tried to send FeatureSet. I don't know how to create one from scratch so i used layer.queryFeatures which should return FeatureSet:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;const &lt;/SPAN&gt;query = {&lt;BR /&gt;    &lt;SPAN&gt;where&lt;/SPAN&gt;: "objectid = 109002"&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;outFields&lt;/SPAN&gt;: [&lt;SPAN&gt;"*"&lt;/SPAN&gt;]&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;returnGeometry&lt;/SPAN&gt;: &lt;SPAN&gt;true&lt;BR /&gt;&lt;/SPAN&gt;}&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;layer.&lt;SPAN&gt;queryFeatures&lt;/SPAN&gt;(query)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Sending the result to ExtractData results in following error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"&lt;STRONG&gt;Invalid value for parameter inputLayers - Details :&lt;/STRONG&gt; "&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also tried creating featureCollection with the same error as above.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How to properly use ExtractData service or maybe there is an easier way to export data do shapefile?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 21:35:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-export-to-shp-using-extractdata/m-p/1326147#M82178</guid>
      <dc:creator>patryks</dc:creator>
      <dc:date>2023-09-06T21:35:21Z</dc:date>
    </item>
  </channel>
</rss>

