<?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: Can I use cursors in a geoprocessing service? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270978#M24930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Can I use cursors (search, insert and update cursors) in a geoprocessing service that is going to be used in a web app? Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any answer to this? Currently working with an update cursor in a python script. Script runs fine stand alone and as a geoprocessing tool. Service says it finishes w/o errors but the table is not updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;many thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Oct 2013 17:37:17 GMT</pubDate>
    <dc:creator>DanielSmith</dc:creator>
    <dc:date>2013-10-10T17:37:17Z</dc:date>
    <item>
      <title>Can I use cursors in a geoprocessing service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270977#M24929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can I use cursors (search, insert and update cursors) in a geoprocessing service that is going to be used in a web app? Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2013 17:53:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270977#M24929</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-08-30T17:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use cursors in a geoprocessing service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270978#M24930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Can I use cursors (search, insert and update cursors) in a geoprocessing service that is going to be used in a web app? Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any answer to this? Currently working with an update cursor in a python script. Script runs fine stand alone and as a geoprocessing tool. Service says it finishes w/o errors but the table is not updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;many thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 17:37:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270978#M24930</guid>
      <dc:creator>DanielSmith</dc:creator>
      <dc:date>2013-10-10T17:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use cursors in a geoprocessing service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270979#M24931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, we can use all the cursors, the problem is usually with the data input. Here is something that works for me. For the inputs (the inputpolygons) make sure you create a python toolbox parameter as a feature set. To make the update occur in the geoprocessing service, make sure when you run the tool in ArcMap that you select the inputs from their actual files (their databases), not the layers in your map. It took a while for me to figure out this. Of course, make sure the arcgisserver can access the data before through the data store. Good luck!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Import arcpy module&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import os, sys, arcpy, traceback, arcgisscripting&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Input_Polygons = "Stewardship"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;with arcpy.da.UpdateCursor(Input_Polygons, ("DateStart", "PlanID", "FFY")) as rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not (row[1] or "").strip(): #covers blank, one blank space, or Null&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datestarstr1 = row[0]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datestarstr2 = str(Datestarstr1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yearonly = Datestarstr2[0:4]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[2] = yearonly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 17:57:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270979#M24931</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-10T17:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use cursors in a geoprocessing service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270980#M24932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;thank you very much. i will test this now. The data will be local to the user so we'll see how this shakes out soon.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 18:23:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270980#M24932</guid>
      <dc:creator>DanielSmith</dc:creator>
      <dc:date>2013-10-10T18:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use cursors in a geoprocessing service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270981#M24933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No problem. Make sure you check the logs in the manager also. It can give you a clue about the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 18:29:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270981#M24933</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-10T18:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use cursors in a geoprocessing service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270982#M24934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just a note:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I started adding more feature class, things stopped working, so I changed this &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Input_Polygons = "Stewardship"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Counties = "Counties"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Input_Polygons = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Counties = arcpy.GetParameterAsText(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And Everything is working again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Oct 2013 20:55:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270982#M24934</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-10T20:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can I use cursors in a geoprocessing service?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270983#M24935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A note on the last note: If use arcpy.GeParameterAsText() it works in arcmap but not when running the gp, because apparently a parameter cannot have a feature class as an input (go figure!), so if you use arcpy.GetParameterAsText() and then have that parameter as a featureset (which I needed for my gp) it won't work in the gp. What I did was to create a variable for that parameter and when I run it inside ArcMap I grab the layer for that feature class (in my case the layer is referencing a feature class in a sde geodatabase). Then I publish the gp, then when I run the geoprocessing service I can grab the file directly from the connection instead of the layer. I hope it will help somebody because it took me a while to figure this out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; Input_Polygons = "Stewardship"&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.UpdateCursor(Input_Polygons, ("DateStart", "PlanID", "FFY")) as rows:&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not (row[1] or "").strip(): #covers blank, one blank space, or Null&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datestarstr1 = row[0]&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Datestarstr2 = str(Datestarstr1) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; yearonly = Datestarstr2[0:4]&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row[2] = yearonly&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 16:25:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-i-use-cursors-in-a-geoprocessing-service/m-p/270983#M24935</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-17T16:25:03Z</dc:date>
    </item>
  </channel>
</rss>

