<?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 feature collection as item in the GIS in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-feature-collection-as-item-in-the-gis/m-p/1094266#M6576</link>
    <description>&lt;P&gt;I am trying to add a feature collection as an item in the GIS without much success. I've an existing layer that I query to get a subset of the features. From this I create a feature collection as in the code below. No problems here.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;feat_set = mylyr.query(where="OBJECTID&amp;gt;500")
feat_collect = arcgis.features.FeatureCollection.from_featureset(feat_set)
feat_collect&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I then try to add this as a new item in the GIS by inserting as a text item.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_properties = {'title': 'Temp',
                        'description':'Temp',
                        'tags': 'temp',
                        'text':feat_collect.properties,
                        'type':'Feature Collection'}
append_featurecollection_item = gis.content.add(item_properties)
append_featurecollection_item&lt;/LI-CODE&gt;&lt;P&gt;This kind of works. The item is created and appears in the GIS and I can see the data table is populated. When I try to view the item in the map viewer I get the following message however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lightpro_0-1630479282490.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22152i9CB4AE510F13FB36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lightpro_0-1630479282490.png" alt="lightpro_0-1630479282490.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Clearly I'm missing something which I suspect is related to the JSON I'm adding to the item as text. I'm guessing my JSON is incomplete as I'm just adding my featurecollection.properties. I haven't been able to figure out the correct format however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what I'm missing?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Sep 2021 06:56:15 GMT</pubDate>
    <dc:creator>lightpro</dc:creator>
    <dc:date>2021-09-01T06:56:15Z</dc:date>
    <item>
      <title>Add feature collection as item in the GIS</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-feature-collection-as-item-in-the-gis/m-p/1094266#M6576</link>
      <description>&lt;P&gt;I am trying to add a feature collection as an item in the GIS without much success. I've an existing layer that I query to get a subset of the features. From this I create a feature collection as in the code below. No problems here.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;feat_set = mylyr.query(where="OBJECTID&amp;gt;500")
feat_collect = arcgis.features.FeatureCollection.from_featureset(feat_set)
feat_collect&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I then try to add this as a new item in the GIS by inserting as a text item.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_properties = {'title': 'Temp',
                        'description':'Temp',
                        'tags': 'temp',
                        'text':feat_collect.properties,
                        'type':'Feature Collection'}
append_featurecollection_item = gis.content.add(item_properties)
append_featurecollection_item&lt;/LI-CODE&gt;&lt;P&gt;This kind of works. The item is created and appears in the GIS and I can see the data table is populated. When I try to view the item in the map viewer I get the following message however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lightpro_0-1630479282490.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22152i9CB4AE510F13FB36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lightpro_0-1630479282490.png" alt="lightpro_0-1630479282490.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Clearly I'm missing something which I suspect is related to the JSON I'm adding to the item as text. I'm guessing my JSON is incomplete as I'm just adding my featurecollection.properties. I haven't been able to figure out the correct format however.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know what I'm missing?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 06:56:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-feature-collection-as-item-in-the-gis/m-p/1094266#M6576</guid>
      <dc:creator>lightpro</dc:creator>
      <dc:date>2021-09-01T06:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Add feature collection as item in the GIS</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/add-feature-collection-as-item-in-the-gis/m-p/1094758#M6583</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/416915"&gt;@lightpro&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;It should work.&lt;/P&gt;&lt;P&gt;You also have the option to add spatial reference to the item properties.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;item_properties = {'title': 'Temp',
                    'description':'Temp',
                    'tags': 'temp',
                    'text':feat_collect.properties,
                    'type':'Feature Collection',
                    'spatialReference':'WGS_1984_Web_Mercator'}
append_featurecollection_item = gis.content.add(item_properties)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;alternatively, you can test it on another feature layer.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 01:07:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/add-feature-collection-as-item-in-the-gis/m-p/1094758#M6583</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-09-02T01:07:13Z</dc:date>
    </item>
  </channel>
</rss>

