<?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 Geoprocessing Service with output Feature Layer in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-with-output-feature-layer/m-p/1291211#M26879</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am trying to successfully return a feature layer as the output of the GP service and having absolutely no luck.&lt;/P&gt;&lt;P&gt;I have a very simple python toolbox tool with the following output parameter:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;out_features = arcpy.Parameter(
            displayName="Output Features",
            name="out_features",
            datatype="GPFeatureRecordSetLayer",
            parameterType="Derived",
            direction="Output")
        
        return [out_features]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main code block looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def execute(self, parameters, messages):
        """The source code of the tool."""
        
        inFeatures = r"D:\Projects\OCTA\LODES\data\Test_GP_Service\Test_GP_Service.gdb\Parcels_SaltLakeSub"
        
        out_fc = arcpy.CreateScratchName("out_features",
                                        data_type="FeatureClass",
                                        workspace=arcpy.env.scratchGDB)
        out_fc = arcpy.analysis.Buffer(inFeatures, out_fc, 100).getOutput(0) 
        
        arcpy.AddMessage(out_fc)
        #parameters[0].value = out_fc
        arcpy.SetParameter(0, out_fc)
        return&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm able to execute the tool successfully and publish the results to a standalone ArcGIS Server.&lt;/P&gt;&lt;P&gt;When I submit the job, the logs say that everything was executed successfully and the feature class in scratch.gdb in the related arcgisjobs folder looks correct on the server.&lt;/P&gt;&lt;P&gt;However, when I try and view the contents of the output either using the REST endpoint by submitting a job using Javascript, it is always empty.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JillianStanford_0-1684517454066.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/71182iC6414D889FA9639E/image-size/large?v=v2&amp;amp;px=999" role="button" title="JillianStanford_0-1684517454066.png" alt="JillianStanford_0-1684517454066.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JillianStanford_0-1684517454066.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Somehow, I'm not setting up the output parameter correctly but I can't figure out the trick.&lt;/P&gt;&lt;P&gt;Any ideas are greatly appreciated.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Jill&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 14:40:15 GMT</pubDate>
    <dc:creator>JillianStanford</dc:creator>
    <dc:date>2023-05-22T14:40:15Z</dc:date>
    <item>
      <title>Geoprocessing Service with output Feature Layer</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-with-output-feature-layer/m-p/1291211#M26879</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;I am trying to successfully return a feature layer as the output of the GP service and having absolutely no luck.&lt;/P&gt;&lt;P&gt;I have a very simple python toolbox tool with the following output parameter:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;out_features = arcpy.Parameter(
            displayName="Output Features",
            name="out_features",
            datatype="GPFeatureRecordSetLayer",
            parameterType="Derived",
            direction="Output")
        
        return [out_features]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main code block looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def execute(self, parameters, messages):
        """The source code of the tool."""
        
        inFeatures = r"D:\Projects\OCTA\LODES\data\Test_GP_Service\Test_GP_Service.gdb\Parcels_SaltLakeSub"
        
        out_fc = arcpy.CreateScratchName("out_features",
                                        data_type="FeatureClass",
                                        workspace=arcpy.env.scratchGDB)
        out_fc = arcpy.analysis.Buffer(inFeatures, out_fc, 100).getOutput(0) 
        
        arcpy.AddMessage(out_fc)
        #parameters[0].value = out_fc
        arcpy.SetParameter(0, out_fc)
        return&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm able to execute the tool successfully and publish the results to a standalone ArcGIS Server.&lt;/P&gt;&lt;P&gt;When I submit the job, the logs say that everything was executed successfully and the feature class in scratch.gdb in the related arcgisjobs folder looks correct on the server.&lt;/P&gt;&lt;P&gt;However, when I try and view the contents of the output either using the REST endpoint by submitting a job using Javascript, it is always empty.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JillianStanford_0-1684517454066.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/71182iC6414D889FA9639E/image-size/large?v=v2&amp;amp;px=999" role="button" title="JillianStanford_0-1684517454066.png" alt="JillianStanford_0-1684517454066.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;JillianStanford_0-1684517454066.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Somehow, I'm not setting up the output parameter correctly but I can't figure out the trick.&lt;/P&gt;&lt;P&gt;Any ideas are greatly appreciated.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Jill&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 14:40:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-with-output-feature-layer/m-p/1291211#M26879</guid>
      <dc:creator>JillianStanford</dc:creator>
      <dc:date>2023-05-22T14:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Service with output Feature Layer</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-with-output-feature-layer/m-p/1292099#M26882</link>
      <description>&lt;P&gt;In case it's helpful to someone else, changing the output parameter type to "DEFeatureClass" did the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;out_features = arcpy.Parameter(
            displayName="Output Features",
            name="out_features",
            datatype="DEFeatureClass",
            parameterType="Derived",
            direction="Output")
        
        return [out_features]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2023 14:46:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/geoprocessing-service-with-output-feature-layer/m-p/1292099#M26882</guid>
      <dc:creator>JillianStanford</dc:creator>
      <dc:date>2023-05-23T14:46:06Z</dc:date>
    </item>
  </channel>
</rss>

