<?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: Join tables to feature classes in batch in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/join-tables-to-feature-classes-in-batch/m-p/38964#M3068</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OL&gt;&lt;LI&gt;Not sure what's happening with&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;if table() == fc():&lt;/SPAN&gt; Are these supposed to be custom functions? if so, could you &lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-8691-posting-code-with-syntax-highlighting-on-geonet"&gt;post the code&lt;/A&gt; for those.&lt;/LI&gt;&lt;LI&gt;It looks like you don't have any field names specified in the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;fields&lt;/SPAN&gt; parameter, which is "the fields from the join table to be included in the join." I think you need to tell it what fields you want appended to your input feature class, otherwise it doesn't really do what you want.&lt;/LI&gt;&lt;LI&gt;You're already using the os module for the path separator, you should go all the way and use &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;os.path.join()&lt;/SPAN&gt; to build your paths.&amp;nbsp;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/filenames-and-file-paths-in-python"&gt;/blogs/dan_patterson/2016/08/14/filenames-and-file-paths-in-python&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jun 2017 16:05:40 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2017-06-14T16:05:40Z</dc:date>
    <item>
      <title>Join tables to feature classes in batch</title>
      <link>https://community.esri.com/t5/python-questions/join-tables-to-feature-classes-in-batch/m-p/38963#M3067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need some help with batch processing using python.&amp;nbsp;I am trying to join fields to multiple point features classes from multiple dbf tables (650 feature classes and tables).&amp;nbsp;Names of the dbf tables match names from&amp;nbsp;each feature class. I have got the script so far; I am not sure where I went wrong as the script runs but feature classes are not updated with the join. I am using&amp;nbsp;arcpy.joinField.management&amp;nbsp;instead of Add Join because I want to update the feature classes directly without having to&amp;nbsp;create feature layer and save. If this where I am wrong, please let me know.&lt;/P&gt;&lt;P&gt;Any help is highly appreciated. My script so far is below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy, os&amp;nbsp; &lt;BR /&gt;from arcpy import env&amp;nbsp; &lt;BR /&gt;&amp;nbsp;# Add variables&amp;nbsp;&lt;BR /&gt;GDB1 = r"C:\test\GDB1.gdb"&amp;nbsp; &lt;BR /&gt;GDB2 = r"C:\test\GDB2.gdb"&amp;nbsp; &lt;BR /&gt;joinField = "Work_ID"&amp;nbsp; &lt;BR /&gt;env.workspace = GDB1&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;#Join&amp;nbsp;tables&amp;nbsp; &lt;BR /&gt;for fc in arcpy.ListFeatureClasses():&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; env.workspace = GDB2&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for table in arcpy.ListTables():&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&amp;nbsp; &lt;BR /&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; if table() == fc():&amp;nbsp; &lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&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;&amp;nbsp;&amp;nbsp;&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.JoinField_management(GDB1 + os.sep + fc, joinField, GDB2 + os.sep + table, joinField, "")&lt;/P&gt;&lt;P&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:&amp;nbsp; &lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Could not join ")&amp;nbsp; &lt;BR /&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:&amp;nbsp; &lt;BR /&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; pass&amp;nbsp; &lt;BR /&gt;env.workspace = GDB1&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jun 2017 13:51:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-tables-to-feature-classes-in-batch/m-p/38963#M3067</guid>
      <dc:creator>PadminiBharadwaj</dc:creator>
      <dc:date>2017-06-13T13:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Join tables to feature classes in batch</title>
      <link>https://community.esri.com/t5/python-questions/join-tables-to-feature-classes-in-batch/m-p/38964#M3068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OL&gt;&lt;LI&gt;Not sure what's happening with&amp;nbsp;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;if table() == fc():&lt;/SPAN&gt; Are these supposed to be custom functions? if so, could you &lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-8691-posting-code-with-syntax-highlighting-on-geonet"&gt;post the code&lt;/A&gt; for those.&lt;/LI&gt;&lt;LI&gt;It looks like you don't have any field names specified in the &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;fields&lt;/SPAN&gt; parameter, which is "the fields from the join table to be included in the join." I think you need to tell it what fields you want appended to your input feature class, otherwise it doesn't really do what you want.&lt;/LI&gt;&lt;LI&gt;You're already using the os module for the path separator, you should go all the way and use &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;os.path.join()&lt;/SPAN&gt; to build your paths.&amp;nbsp;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/filenames-and-file-paths-in-python"&gt;/blogs/dan_patterson/2016/08/14/filenames-and-file-paths-in-python&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jun 2017 16:05:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/join-tables-to-feature-classes-in-batch/m-p/38964#M3068</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2017-06-14T16:05:40Z</dc:date>
    </item>
  </channel>
</rss>

