<?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:  arcpy.ma addTable method of Map class doesn't work for .dbf table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/1023254#M59784</link>
    <description>&lt;P&gt;I was having the same issue while trying to add a dbf table using the addTable method (m.addTable(tbl)). Using the addDataFromPath (data_path) method worked for me. &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm&lt;/A&gt;&amp;nbsp;: addDataFromPath.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Feb 2021 00:46:34 GMT</pubDate>
    <dc:creator>MichelMelanson1</dc:creator>
    <dc:date>2021-02-04T00:46:34Z</dc:date>
    <item>
      <title>arcpy.ma addTable method of Map class doesn't work for .dbf table</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/123504#M9599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ArcGIS Pro 2.2&lt;/P&gt;&lt;P&gt;Python 3.6&lt;/P&gt;&lt;P&gt;I am trying to add a .dbf table from disk to an existing map in an ArcGIS Pro project. The addTable method of the Map class works with a file geodatabase table, but does not work with a .dbf table. I created a simple map and script tool to test this, and a python script tool with a single input parameter of type "Table"&lt;/P&gt;&lt;P&gt;Here is the python script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#script tool for testing addTable&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;theTable = arcpy.GetParameterAsText(0)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;theProject = arcpy.mp.ArcGISProject("CURRENT")&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;arcpy.AddMessage(theTable)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;theMap = theProject.listMaps()[0]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#now add table to map - use table function of mp to create a table object &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;# then use addTable method of map to add the table&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;theSumTab = arcpy.mp.Table(theTable)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;theMap.addTable(theSumTab)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I test this script tool by navigating to a file geodatabase table everything works:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/431299_addgdbtable.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I test this script tool by navigating to a .dbf table it fails:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/431339_AddDBFTable.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need to do something differently in order for this to work with a .dbf table? Or does addTable just not have that functionality. It doesn't specify that in the help: &lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sheila Churchill&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2018 19:29:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/123504#M9599</guid>
      <dc:creator>SheilaChurchill1</dc:creator>
      <dc:date>2018-12-11T19:29:19Z</dc:date>
    </item>
    <item>
      <title>Re:  arcpy.ma addTable method of Map class doesn't work for .dbf table</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/123505#M9600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you might want to check for the dbase instance&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/functions/dbase-table-properties.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/functions/dbase-table-properties.htm"&gt;dBase Table properties—ArcPy Functions | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;copy rows supports dbase&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/copy-rows.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/copy-rows.htm"&gt;Copy Rows—Data Management toolbox | ArcGIS Desktop&lt;/A&gt; and&lt;/P&gt;&lt;P&gt;tabletotable&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/conversion/table-to-table.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/conversion/table-to-table.htm"&gt;Table To Table—Conversion toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;List tables provides the list&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm"&gt;Map—ArcPy | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if they exist in the map&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/table-class.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/mapping/table-class.htm"&gt;Table—ArcPy | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I would make a featureclass table from the dbf if you want shorten what needs to be cheked, but the dbase table properties allows you to check for them&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2018 22:22:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/123505#M9600</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-12-11T22:22:20Z</dc:date>
    </item>
    <item>
      <title>Re:  arcpy.ma addTable method of Map class doesn't work for .dbf table</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/123506#M9601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for replying Dan. I do not want to have to convert the .dbf table to a file geodatabase table, which is what copy rows or table to table does. If the .dbf table has already been added to the map manually, listTables will&amp;nbsp;return it in the list.&amp;nbsp; I did try your suggestion of the Describe function to look at the table properties. However, that made me realize my script is failing when I use the Table function of arcpy.ma, not the addTable method of the map. So I am not able to&amp;nbsp;use the Table function of arcpy.ma to create a table object from the string holding the table data source&amp;nbsp; as it outlines in the help ( &lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/mapping/table.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/mapping/table.htm"&gt;Table—ArcPy | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;). Perhaps the string that represents the data source of the .dbf table needs to be in a different format - I have encountered issues with coverages and ArcGIS Pro, maybe there are issues with dbf tables associated with shapefiles too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2018 20:15:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/123506#M9601</guid>
      <dc:creator>SheilaChurchill1</dc:creator>
      <dc:date>2018-12-12T20:15:08Z</dc:date>
    </item>
    <item>
      <title>Re:  arcpy.ma addTable method of Map class doesn't work for .dbf table</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/123507#M9602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worth a check... the describe property for the dbf is quite specific.&amp;nbsp; The string representing the dbf would just have to include its file extension, it wouldn't matter if it was part of a shapefile&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2018 20:50:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/123507#M9602</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-12-12T20:50:31Z</dc:date>
    </item>
    <item>
      <title>Re:  arcpy.ma addTable method of Map class doesn't work for .dbf table</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/1023254#M59784</link>
      <description>&lt;P&gt;I was having the same issue while trying to add a dbf table using the addTable method (m.addTable(tbl)). Using the addDataFromPath (data_path) method worked for me. &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/map-class.htm&lt;/A&gt;&amp;nbsp;: addDataFromPath.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 00:46:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-ma-addtable-method-of-map-class-doesn-t-work/m-p/1023254#M59784</guid>
      <dc:creator>MichelMelanson1</dc:creator>
      <dc:date>2021-02-04T00:46:34Z</dc:date>
    </item>
  </channel>
</rss>

