<?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: Create Geoprocessing Service from Python Script Tool for use in Web App Builder in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/create-geoprocessing-service-from-python-script/m-p/1349067#M27040</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to publish the tool to the server to make it gp service.&lt;/P&gt;&lt;P&gt;You have some issue with such a script as a service.&lt;/P&gt;&lt;P&gt;Does the server (and the user that runs it) have access to the fc and dest_path?&lt;/P&gt;&lt;P&gt;Using gp services need some thinking about access rights and multiple requests from different users&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2023 06:14:48 GMT</pubDate>
    <dc:creator>mody_buchbinder</dc:creator>
    <dc:date>2023-11-14T06:14:48Z</dc:date>
    <item>
      <title>Create Geoprocessing Service from Python Script Tool for use in Web App Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-geoprocessing-service-from-python-script/m-p/1348944#M27039</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm trying to piece this process together, but can anyone point me in the direction on how to publish a python script tool to ArcGIS Server as a geoprocessing service for the purpose of using it within the geoprocessing widget in ArcGIS Web App Builder?&amp;nbsp; The script tool runs successfully within Pro, but ideally I would like to use it within an existing Web App Builder application. The script tool uses an input polygon layer, which has a URL link to a pdf document for each polygon record.&amp;nbsp; Within ArcGIS Pro and after selecting polygons, the tool will output the pdf documents to a specified output folder (technically an input parameter).&amp;nbsp; Assuming that this tool can be published as a geoprocessing service, how would the user select polygons within the web app builder application or geoprocessing widget?&amp;nbsp; Below is the python code for the for the tool as well as a snip of the tool in ArcGIS Pro and a list of its parameters.&amp;nbsp; Any help or guidance on this subject would be greatly appreciated!&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy
import os
import requests

fc = arcpy.GetParameterAsText(0)
dest_path = arcpy.GetParameterAsText(1)
print(fc)
cursor = arcpy.SearchCursor(fc)
with arcpy.da.SearchCursor(fc, ['LINK']) as cursor:
    for row in cursor:
        print("Downloading: " + row[0])
        response = requests.get(row[0])
        outputFile = row[0].split("/")[5]
        print(outputFile)
        with open(dest_path + '\\' + outputFile, 'wb') as f:
            print(f)
            f.write(response.content)
del cursor&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shildebrand_0-1699910933550.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85858i2AF3856597901661/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shildebrand_0-1699910933550.png" alt="shildebrand_0-1699910933550.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="shildebrand_1-1699910975338.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/85859iF5B0E7E4708EE8AC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="shildebrand_1-1699910975338.png" alt="shildebrand_1-1699910975338.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 21:37:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-geoprocessing-service-from-python-script/m-p/1348944#M27039</guid>
      <dc:creator>shildebrand</dc:creator>
      <dc:date>2023-11-13T21:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geoprocessing Service from Python Script Tool for use in Web App Builder</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-geoprocessing-service-from-python-script/m-p/1349067#M27040</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to publish the tool to the server to make it gp service.&lt;/P&gt;&lt;P&gt;You have some issue with such a script as a service.&lt;/P&gt;&lt;P&gt;Does the server (and the user that runs it) have access to the fc and dest_path?&lt;/P&gt;&lt;P&gt;Using gp services need some thinking about access rights and multiple requests from different users&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 06:14:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-geoprocessing-service-from-python-script/m-p/1349067#M27040</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2023-11-14T06:14:48Z</dc:date>
    </item>
  </channel>
</rss>

