<?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 ArcServer GP service, Have rest endpoint return Json in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcserver-gp-service-have-rest-endpoint-return/m-p/67831#M5548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've creates several GPS services some select features as a task but how can I get a GPS service to select features and return them as JSON, like you can with a featureService or by querying a MapService. I know there is a arcpy command to convert a fc to JSON but that just makes a file. When I run my GP services they say executed and successful but don't return data. Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The end result would be to hit the rest endpoint with a few parameters and get JSON back on the url page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2015 16:38:05 GMT</pubDate>
    <dc:creator>BillChappell</dc:creator>
    <dc:date>2015-11-02T16:38:05Z</dc:date>
    <item>
      <title>ArcServer GP service, Have rest endpoint return Json</title>
      <link>https://community.esri.com/t5/python-questions/arcserver-gp-service-have-rest-endpoint-return/m-p/67831#M5548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've creates several GPS services some select features as a task but how can I get a GPS service to select features and return them as JSON, like you can with a featureService or by querying a MapService. I know there is a arcpy command to convert a fc to JSON but that just makes a file. When I run my GP services they say executed and successful but don't return data. Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The end result would be to hit the rest endpoint with a few parameters and get JSON back on the url page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2015 16:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcserver-gp-service-have-rest-endpoint-return/m-p/67831#M5548</guid>
      <dc:creator>BillChappell</dc:creator>
      <dc:date>2015-11-02T16:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: ArcServer GP service, Have rest endpoint return Json</title>
      <link>https://community.esri.com/t5/python-questions/arcserver-gp-service-have-rest-endpoint-return/m-p/67832#M5549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have an output parameter within your GP service?&amp;nbsp; If not, set your final output as an output parameter and it'll be returning the the table of contents when run in ArcMap and as JSON when run in a web client or from REST.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 17:22:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcserver-gp-service-have-rest-endpoint-return/m-p/67832#M5549</guid>
      <dc:creator>JonathanQuinn</dc:creator>
      <dc:date>2015-11-03T17:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: ArcServer GP service, Have rest endpoint return Json</title>
      <link>https://community.esri.com/t5/python-questions/arcserver-gp-service-have-rest-endpoint-return/m-p/67833#M5550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a model it ran without defining the output, however as a python script you had to work it in the parameter GUI, I wish they had documented it somewhere Google would have found it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I took the selected features in Python to CopyRows(Creates Table)&amp;nbsp; and then when making the parameters called it Output, said it was a Table, and selected direction Output in the parameter GUI (input was the default value), then in the python script make sure it said arcpy.GetParameter(5) not GetParameterAsTest(5) then I ran it and it worked. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran it in Sync mode and it returned JSON. Before I was writing back to my fileGDB now just using in_memory to avoid disk ops and it's faster and avoids multiple user conflicts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gotcha was "&lt;STRONG&gt;final output as an output parameter&lt;/STRONG&gt;" miss this and it will want an existing table as input, throwing you a curve. Also setting it as Table not string, you want the object not name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now our programmers hit our GIS tables&amp;nbsp; and have some of the GIS functionality available through REST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Nov 2015 19:02:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcserver-gp-service-have-rest-endpoint-return/m-p/67833#M5550</guid>
      <dc:creator>BillChappell</dc:creator>
      <dc:date>2015-11-03T19:02:30Z</dc:date>
    </item>
  </channel>
</rss>

