<?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 related table from a Feature Collection to WebMap  in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-related-table-from-a-feature-collection-to/m-p/831865#M3197</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a follow up question in respect to adding feature layers to a web map&amp;nbsp;(I can do this now). I also have a related table to a feature layer in a feature collection. I can identify that table through a search, but there seems to be no way to get the itemid of that table (to create an item, in order to add it to the web map) and also, a web map only has &amp;nbsp;"add_layer" functionality, nothing like "add_table" or similar. Is it possible to add a related table from a FeatureCollection to a web map?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a web map object I can use to add layers (and hopefully add a related table) - defined earlier in the code named "web_map_obj"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I search for the layers and tables to add: &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to_be_updated_search = gis.content.search('&amp;lt;my search string&amp;gt;', 'Feature Layer')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I can also use 'Feature Layer Collection' for the above qualifier, both work.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for search_layer in to_be_updated_search: &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if '&amp;lt;my specific feature collection search string&amp;gt;' in search_layer['title']:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to_be_updated_item = gis.content.get(search_layer.itemid)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to_be_updated_flc = FeatureLayerCollection.fromitem(to_be_updated_item)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Here I get the table(s) from the feature collection &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to_be_updated_table = to_be_updated_flc.tables&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # For the table, I cannot seem to find the itemid to create an item, I could only find serviceItemId &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print (to_be_updated_table[0].properties['serviceItemId'])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; add_table = (to_be_updated_table[0].properties['serviceItemId']) -- try to create a table item, this could be wrong&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# The web map object does not seem to have a function to add a table, I used "get" but that does not do anything&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; web_map_obj.get(add_table)&lt;BR /&gt;web_map_obj.update()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jun 2018 02:30:39 GMT</pubDate>
    <dc:creator>HugoBouckaert1</dc:creator>
    <dc:date>2018-06-22T02:30:39Z</dc:date>
    <item>
      <title>Add related table from a Feature Collection to WebMap</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-related-table-from-a-feature-collection-to/m-p/831865#M3197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a follow up question in respect to adding feature layers to a web map&amp;nbsp;(I can do this now). I also have a related table to a feature layer in a feature collection. I can identify that table through a search, but there seems to be no way to get the itemid of that table (to create an item, in order to add it to the web map) and also, a web map only has &amp;nbsp;"add_layer" functionality, nothing like "add_table" or similar. Is it possible to add a related table from a FeatureCollection to a web map?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a web map object I can use to add layers (and hopefully add a related table) - defined earlier in the code named "web_map_obj"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I search for the layers and tables to add: &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to_be_updated_search = gis.content.search('&amp;lt;my search string&amp;gt;', 'Feature Layer')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(I can also use 'Feature Layer Collection' for the above qualifier, both work.)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for search_layer in to_be_updated_search: &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if '&amp;lt;my specific feature collection search string&amp;gt;' in search_layer['title']:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to_be_updated_item = gis.content.get(search_layer.itemid)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to_be_updated_flc = FeatureLayerCollection.fromitem(to_be_updated_item)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Here I get the table(s) from the feature collection &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to_be_updated_table = to_be_updated_flc.tables&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # For the table, I cannot seem to find the itemid to create an item, I could only find serviceItemId &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print (to_be_updated_table[0].properties['serviceItemId'])&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; add_table = (to_be_updated_table[0].properties['serviceItemId']) -- try to create a table item, this could be wrong&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# The web map object does not seem to have a function to add a table, I used "get" but that does not do anything&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; web_map_obj.get(add_table)&lt;BR /&gt;web_map_obj.update()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2018 02:30:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-related-table-from-a-feature-collection-to/m-p/831865#M3197</guid>
      <dc:creator>HugoBouckaert1</dc:creator>
      <dc:date>2018-06-22T02:30:39Z</dc:date>
    </item>
  </channel>
</rss>

