<?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 Add field: error in executing tool in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/add-field-error-in-executing-tool/m-p/576220#M45183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to add a field to all layers with multiple GDB's. Am I unable to collect a list of values and run addField tool on them?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy import os, math from arcpy import env&amp;nbsp;&amp;nbsp; in_workspace = r"F:/test/testRnd" rndValue = "int(round(!ELEVATION!, -2))" fcList = [] fieldName = "SL_ELEV" for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, datatype="FeatureClass",type="All"): &amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in filenames: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcList.append(os.path.join(dirpath, filename))&amp;nbsp; #Add new field arcpy.AddField_management(fcList, fieldName, "SHORT", "", "", "", "", "NULLABLE")&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jun 2013 16:19:39 GMT</pubDate>
    <dc:creator>ChrisBrannin</dc:creator>
    <dc:date>2013-06-06T16:19:39Z</dc:date>
    <item>
      <title>Add field: error in executing tool</title>
      <link>https://community.esri.com/t5/python-questions/add-field-error-in-executing-tool/m-p/576220#M45183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to add a field to all layers with multiple GDB's. Am I unable to collect a list of values and run addField tool on them?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy import os, math from arcpy import env&amp;nbsp;&amp;nbsp; in_workspace = r"F:/test/testRnd" rndValue = "int(round(!ELEVATION!, -2))" fcList = [] fieldName = "SL_ELEV" for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, datatype="FeatureClass",type="All"): &amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in filenames: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcList.append(os.path.join(dirpath, filename))&amp;nbsp; #Add new field arcpy.AddField_management(fcList, fieldName, "SHORT", "", "", "", "", "NULLABLE")&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 16:19:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-field-error-in-executing-tool/m-p/576220#M45183</guid>
      <dc:creator>ChrisBrannin</dc:creator>
      <dc:date>2013-06-06T16:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add field: error in executing tool</title>
      <link>https://community.esri.com/t5/python-questions/add-field-error-in-executing-tool/m-p/576221#M45184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am trying to add a field to all layers with multiple GDB's. Am I unable to collect a list of values and run addField tool on them?&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy import os, math from arcpy import env&amp;nbsp;&amp;nbsp; in_workspace = r"F:/test/testRnd" rndValue = "int(round(!ELEVATION!, -2))" fcList = [] fieldName = "SL_ELEV" for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, datatype="FeatureClass",type="All"): &amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in filenames: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcList.append(os.path.join(dirpath, filename))&amp;nbsp; #Add new field arcpy.AddField_management(fcList, fieldName, "SHORT", "", "", "", "", "NULLABLE")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;Thanks&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I just needed to run another loop. This got it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, datatype="FeatureClass",type="All"): &amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in filenames: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fcList.append(os.path.join(dirpath, filename))&amp;nbsp;&amp;nbsp; for list in fcList: &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(list, fieldName, "SHORT", "", "", "", "", "NULLABLE")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 16:28:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/add-field-error-in-executing-tool/m-p/576221#M45184</guid>
      <dc:creator>ChrisBrannin</dc:creator>
      <dc:date>2013-06-06T16:28:54Z</dc:date>
    </item>
  </channel>
</rss>

