<?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 Re: Run GP Tool from JavaScript in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/run-gp-tool-from-javascript/m-p/1121265#M75438</link>
    <description>&lt;P&gt;If you're using 4.13, you can use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#execute" target="_self"&gt;Geoprocessor task&lt;/A&gt;. In current releases, it is deprecated in favor of the if the rest methods &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-geoprocessor.html#execute" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 15:33:13 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2021-11-30T15:33:13Z</dc:date>
    <item>
      <title>Run GP Tool from JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/run-gp-tool-from-javascript/m-p/1121251#M75437</link>
      <description>&lt;P&gt;I have an existing Publish GP Tool that accepts a couple Parameters.&amp;nbsp; It does its thing and then passes back some results.&amp;nbsp; Something is going on and I want to rewrite this persons code but before doing so I want to make sure I am doing this the most logical way.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Current project is using API 4.13&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SERVICE OVERVIEW&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Execution Type:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;esriExecutionTypeSynchronous&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Supported Operations&lt;/STRONG&gt;: &amp;nbsp;&amp;nbsp;&lt;A href="https://servicesdev.dwr.virginia.gov/arcgis/rest/services/NeoVafwis/Report_GP/GPServer/VafwisSearch/execute" target="_blank"&gt;Execute Task&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&amp;nbsp;CREDENTIALS&lt;/STRONG&gt; - I need to add to this a Token that the service will require as its secured. How do I add the token&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;BELOW&lt;/STRONG&gt; are the params I am looking to send&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;NOTING&lt;/STRONG&gt; - I need to use the EXECUTE not SUBMIT as that is what the service requires&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone help with an example to show me the correct syntax etc to CALL and then grab the RESULTS and simply put in an ALERT box????&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;            let params = {
                "site": FeatureSet.fromJSON(
                    {
                        "geometryType": geometryType9,
                        "spatialReference": { "wkid": 102100 },
                        "features": [
                            {
                                "attributes": {
                                    "OBJECTID": 0
                                },
                                "geometry": geometry9
                            }
                        ]
                    }
                ),
                "Buffer_Distance": LinearUnit.fromJSON({
                    "distance": xxx.Session.searchRequestTextbox.bufferDistance,
                    "units": "miles"
                }),
                "user": UserRole,
                "Report_Type": xxxx.Session.searchRequestTextbox.reportType
            };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 14:55:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/run-gp-tool-from-javascript/m-p/1121251#M75437</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2021-11-30T14:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Run GP Tool from JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/run-gp-tool-from-javascript/m-p/1121265#M75438</link>
      <description>&lt;P&gt;If you're using 4.13, you can use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-tasks-Geoprocessor.html#execute" target="_self"&gt;Geoprocessor task&lt;/A&gt;. In current releases, it is deprecated in favor of the if the rest methods &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-geoprocessor.html#execute" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 15:33:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/run-gp-tool-from-javascript/m-p/1121265#M75438</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-11-30T15:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Run GP Tool from JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/run-gp-tool-from-javascript/m-p/1121315#M75440</link>
      <description>&lt;P&gt;Does the later have an actual example....I dont think you can just write execute(xyz,xyz,xyz)&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 14:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/run-gp-tool-from-javascript/m-p/1121315#M75440</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2024-07-01T14:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Run GP Tool from JavaScript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/run-gp-tool-from-javascript/m-p/1121336#M75441</link>
      <description>&lt;P&gt;The samples for 4.13 are no longer available.&lt;/P&gt;&lt;P&gt;This sample is still using the GP Task&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=geoprocessing-hotspot" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=geoprocessing-hotspot&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here is a sample using the task in 3.x, it's very similar to how you would do it in 4.13 to get another look.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/3/jssamples/gp_viewshed.html" target="_blank"&gt;https://developers.arcgis.com/javascript/3/jssamples/gp_viewshed.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 17:45:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/run-gp-tool-from-javascript/m-p/1121336#M75441</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-11-30T17:45:46Z</dc:date>
    </item>
  </channel>
</rss>

