<?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: Calling arcpy.da.Editor from geoprocessing service in webapp in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060811#M61212</link>
    <description>&lt;P&gt;Thanks Blake. The connection files sit on a shared folder, so there should be no need for the drive letter, but did I try your both of your suggestions (without success)&lt;/P&gt;</description>
    <pubDate>Sun, 23 May 2021 23:59:05 GMT</pubDate>
    <dc:creator>_watcher_</dc:creator>
    <dc:date>2021-05-23T23:59:05Z</dc:date>
    <item>
      <title>Calling arcpy.da.Editor from geoprocessing service in webapp</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060255#M61180</link>
      <description>&lt;P&gt;I’m a newbie so please excuse a dumb question; I’m just finding the documentation rather confusing.&lt;/P&gt;&lt;P&gt;Can I use arcpy.da.Editor in a geoprocessing service called by a web app? If I can, how do I determine what the workspace is?&lt;/P&gt;&lt;P&gt;This is the code I’m attempting to use:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;edit = arcpy.da.Editor(arcpy.env.workspace)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;edit.startEditing(False, False)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;edit.startOperation()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;// my code here&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;edit.stopOperation()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;edit.stopEditing(True)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The full story is there’s an existing ArcMap addin with a toolbox module. I’m attempting to publish the toolbox as a set of geoprocessing services, which will be called from geoprocessing widgets in a new web app (created with web appbuilder). At the moment, calling any of the geoprocessing service is failing with the error “cannot open workspace”.&lt;/P&gt;&lt;P&gt;It seems logical that there might be some extra set up required before trying to get the workspace; this is a web app, not ArcMap (when used in ArcMap, the workspace comes from a settings file). But I’m not sure if it’s even possible to do what the code is trying to do. Because this is an existing (unfamiliar!) codebase, I’m also trying to minimise the changes and identify if the code needs to diverge in order to support the web app.&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 01:55:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060255#M61180</guid>
      <dc:creator>_watcher_</dc:creator>
      <dc:date>2021-05-21T01:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calling arcpy.da.Editor from geoprocessing service in webapp</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060258#M61181</link>
      <description>&lt;P&gt;The workspace would be a geodatabase or a folder (for shapefies).&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/data-access/editor.htm" target="_blank"&gt;Editor—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 02:19:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060258#M61181</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-05-21T02:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calling arcpy.da.Editor from geoprocessing service in webapp</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060261#M61182</link>
      <description>&lt;P&gt;Thanks Dan!&lt;/P&gt;&lt;P&gt;Something like this perhaps?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;arcpy.env.workspace = r"//[servername]/connections/dbconnection.sde"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 02:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060261#M61182</guid>
      <dc:creator>_watcher_</dc:creator>
      <dc:date>2021-05-21T02:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calling arcpy.da.Editor from geoprocessing service in webapp</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060426#M61190</link>
      <description>&lt;P&gt;It would be&amp;nbsp;&lt;FONT face="courier new,courier"&gt;arcpy.env.workspace = r"\\[servername]\connections\dbconnection.sde"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;If you really are going to a database connected saved on a different server, you'll have to include a drive letter like&amp;nbsp;&lt;FONT face="courier new,courier"&gt;arcpy.env.workspace = r"\\[servername]\c$\connections\dbconnection.sde"&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 14:34:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060426#M61190</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-05-21T14:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calling arcpy.da.Editor from geoprocessing service in webapp</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060508#M61194</link>
      <description>&lt;P&gt;I have to ask, why wouldn't you edit a feature service instead of trying to use Editor?&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 17:00:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060508#M61194</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-05-21T17:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calling arcpy.da.Editor from geoprocessing service in webapp</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060811#M61212</link>
      <description>&lt;P&gt;Thanks Blake. The connection files sit on a shared folder, so there should be no need for the drive letter, but did I try your both of your suggestions (without success)&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 23:59:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060811#M61212</guid>
      <dc:creator>_watcher_</dc:creator>
      <dc:date>2021-05-23T23:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calling arcpy.da.Editor from geoprocessing service in webapp</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060815#M61214</link>
      <description>&lt;P&gt;There's an existing toolbox in use in ArcMap containing the functionality that is tested and works. All that's wanted is to provide an additional access point via web app.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 00:51:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060815#M61214</guid>
      <dc:creator>_watcher_</dc:creator>
      <dc:date>2021-05-24T00:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calling arcpy.da.Editor from geoprocessing service in webapp</title>
      <link>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060816#M61215</link>
      <description>&lt;P&gt;Ok, so according to this question&amp;nbsp;&lt;A href="https://community.esri.com/t5/python-questions/why-would-a-python-script-run-fine-from-within-arcmap-but-not-as/m-p/606240#M47372" target="_blank" rel="noopener"&gt;Why would a python script run fine from within ArcMap but not as a geoprocessing service?&lt;/A&gt;&amp;nbsp; I need to do the following:&lt;/P&gt;&lt;P&gt;arcpy.env.workspace = os.path.dirname(&lt;SPAN&gt;r"//[servername]/connections/dbconnection.sde")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This call cuts off the dbconnection.sde part of the path. Not sure why this fixes the problem, but I'm now onto a different error in a different part of the code, so that's one step further than I was before.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 01:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calling-arcpy-da-editor-from-geoprocessing-service/m-p/1060816#M61215</guid>
      <dc:creator>_watcher_</dc:creator>
      <dc:date>2021-05-24T01:00:56Z</dc:date>
    </item>
  </channel>
</rss>

