<?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 Trying to run geoprocessing tool against service on portal... in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/trying-to-run-geoprocessing-tool-against-service/m-p/799473#M2002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not quite sure where this should go, so cross posting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have an on premise portal with a feature service published.&amp;nbsp; We're trying to write a python script that will run a geoprocessing tool against this service.&amp;nbsp; Right now it's extremely simple; authenticate to portal, look at the service, and run arcpy.Statistics_analysis against it.&amp;nbsp; All we want to do is get an output table of statistics. Now, if I do this in python directly against the database, no problems.&amp;nbsp; But when running it against the service... it SEES the service, but it fails on the analysis.&amp;nbsp; Can anyone help??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;def run(self):&lt;BR /&gt; self._sign_into_portal()&lt;BR /&gt; #self._build_scratch_fgdb()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; lines = arcpy.SearchCursor(&lt;BR /&gt; "https://servername/arcgis/rest/services/DENC/Yanceyville_UN/FeatureServer/3"&lt;BR /&gt; )&lt;/P&gt;&lt;P&gt;for line in lines:&lt;BR /&gt; print(line.getValue("OBJECTID"))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; stats_table = "C:/temp/services_test.gdb/stats_out"&lt;BR /&gt; stat = [["st_length", "SUM"]]&lt;/P&gt;&lt;P&gt;arcpy.Statistics_analysis(lines, stats_table, stat)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Dec 2019 15:54:23 GMT</pubDate>
    <dc:creator>KarenEllett</dc:creator>
    <dc:date>2019-12-16T15:54:23Z</dc:date>
    <item>
      <title>Trying to run geoprocessing tool against service on portal...</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/trying-to-run-geoprocessing-tool-against-service/m-p/799473#M2002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not quite sure where this should go, so cross posting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have an on premise portal with a feature service published.&amp;nbsp; We're trying to write a python script that will run a geoprocessing tool against this service.&amp;nbsp; Right now it's extremely simple; authenticate to portal, look at the service, and run arcpy.Statistics_analysis against it.&amp;nbsp; All we want to do is get an output table of statistics. Now, if I do this in python directly against the database, no problems.&amp;nbsp; But when running it against the service... it SEES the service, but it fails on the analysis.&amp;nbsp; Can anyone help??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;def run(self):&lt;BR /&gt; self._sign_into_portal()&lt;BR /&gt; #self._build_scratch_fgdb()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; lines = arcpy.SearchCursor(&lt;BR /&gt; "https://servername/arcgis/rest/services/DENC/Yanceyville_UN/FeatureServer/3"&lt;BR /&gt; )&lt;/P&gt;&lt;P&gt;for line in lines:&lt;BR /&gt; print(line.getValue("OBJECTID"))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; stats_table = "C:/temp/services_test.gdb/stats_out"&lt;BR /&gt; stat = [["st_length", "SUM"]]&lt;/P&gt;&lt;P&gt;arcpy.Statistics_analysis(lines, stats_table, stat)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2019 15:54:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/trying-to-run-geoprocessing-tool-against-service/m-p/799473#M2002</guid>
      <dc:creator>KarenEllett</dc:creator>
      <dc:date>2019-12-16T15:54:23Z</dc:date>
    </item>
  </channel>
</rss>

