<?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 ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/geoprocessing-service-with-output-feature-layer/m-p/1291187#M69366</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;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;The main code block looks like this:&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;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&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;Thanks!&lt;/P&gt;&lt;P&gt;Jill&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 14:38:51 GMT</pubDate>
    <dc:creator>JillianStanford</dc:creator>
    <dc:date>2023-05-22T14:38:51Z</dc:date>
    <item>
      <title>Geoprocessing Service with output Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/geoprocessing-service-with-output-feature-layer/m-p/1291187#M69366</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;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;The main code block looks like this:&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;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&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;Thanks!&lt;/P&gt;&lt;P&gt;Jill&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 14:38:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/geoprocessing-service-with-output-feature-layer/m-p/1291187#M69366</guid>
      <dc:creator>JillianStanford</dc:creator>
      <dc:date>2023-05-22T14:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Service with output Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/geoprocessing-service-with-output-feature-layer/m-p/1292098#M69451</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;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;</description>
      <pubDate>Tue, 23 May 2023 14:45:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/geoprocessing-service-with-output-feature-layer/m-p/1292098#M69451</guid>
      <dc:creator>JillianStanford</dc:creator>
      <dc:date>2023-05-23T14:45:29Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Service with output Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/geoprocessing-service-with-output-feature-layer/m-p/1584511#M92971</link>
      <description>&lt;P&gt;Hi Jillian,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having the same issue that unable to see the output through javascript but on standalone it works perfectly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to set up the Parameters through ArcGIS Pro and I do not see the option named DEFeatureClass. Do you know what name would be similar to DE Feature class?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 17:02:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/geoprocessing-service-with-output-feature-layer/m-p/1584511#M92971</guid>
      <dc:creator>PrayagShah</dc:creator>
      <dc:date>2025-02-12T17:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Geoprocessing Service with output Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/geoprocessing-service-with-output-feature-layer/m-p/1584566#M92978</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think it would just be a feature class -&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/geoprocessing_and_python/defining-parameter-data-types-in-a-python-toolbox.htm#ESRI_SECTION1_A6F5518564FF4125B7C410F3DF3C3003" target="_blank" rel="noopener"&gt;Parameter data types in a Python toolbox&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JillianStanford_0-1739384262422.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/125167iBEF599E0AA73EC87/image-size/large?v=v2&amp;amp;px=999" role="button" title="JillianStanford_0-1739384262422.png" alt="JillianStanford_0-1739384262422.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2025 18:19:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/geoprocessing-service-with-output-feature-layer/m-p/1584566#M92978</guid>
      <dc:creator>JillianStanford</dc:creator>
      <dc:date>2025-02-12T18:19:10Z</dc:date>
    </item>
  </channel>
</rss>

