<?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: Accessing Feature Layer Collection Properties in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261572#M50533</link>
    <description>&lt;P&gt;Hi MobiusSnake, I can access the properties now. For the alternative title, I realized it was something my organization formatted into each item's description, I'm sorry for any confusion I caused. Thank you so much for all your help!&lt;/P&gt;</description>
    <pubDate>Fri, 24 Feb 2023 19:25:44 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2023-02-24T19:25:44Z</dc:date>
    <item>
      <title>Accessing Feature Layer Collection Properties</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1260620#M50501</link>
      <description>&lt;P&gt;Hi, I'm trying to query and edit my feature layer collection's alternative titles and layer names but can't access either property. This is the code I'm testing with:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;groups = gis.groups.search()
for g in groups: # looping through groups
    content = g.content()
    print(content) # printing list of each group's content
    for c in content:
        print(c) # printing each group's content separately as an item, has type Feature Layer Collection
        print(c.properties) # trying to print content's properties for viewing&lt;/LI-CODE&gt;&lt;P&gt;From the API's documentation, I wanted to use the ``.properties`` command&amp;nbsp; to access the feature layer collection's properties but this line in my code outputted None.&lt;/P&gt;&lt;P&gt;Is ``.properties`` the correct command to use and if not, could someone point me in the right direction? For each of the Feature Layer Collections that I'm looping through in the second loop, I'm trying to access and edit the alternative title and layer name.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 19:19:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1260620#M50501</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-02-22T19:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Feature Layer Collection Properties</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1260647#M50505</link>
      <description>&lt;P&gt;The search() method gives you back Item objects, not just feature layers.&amp;nbsp; You could get S123 forms, web maps, all kinds of other stuff.&amp;nbsp; You need to filter the results, either pre-query using the weird query language that the content API uses, or checking each returned item.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 20:50:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1260647#M50505</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2023-02-22T20:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Feature Layer Collection Properties</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1260681#M50507</link>
      <description>&lt;P&gt;Hi MobiusSnake, thanks for your response! I was planning on checking each returned item and if their alternative title is empty or what I'm searching for, I'd set it to be the same as the layer name. However, right now I'm unable to access these values to check or pre-query. Any ideas on the syntax to access the properties for pre-querying or checking returns?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 22:00:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1260681#M50507</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-02-22T22:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Feature Layer Collection Properties</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1260757#M50509</link>
      <description>&lt;P&gt;Bunch of ways to do this, but if you want to do it quick and greasy, use the FeatureLayerCollection::fromitem class method.&amp;nbsp; Wrap some exception handling around that, bam!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 03:20:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1260757#M50509</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2023-02-23T03:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Feature Layer Collection Properties</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261072#M50519</link>
      <description>&lt;P&gt;Thanks for the suggestion! I'm trying it now and tried it twice so far: once with my content and once following the documentation's example:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/updating-feature-layer-properties/" target="_blank"&gt;https://developers.arcgis.com/python/guide/updating-feature-layer-properties/&lt;/A&gt;&amp;nbsp;but both times, I'm getting this same error:&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;AttributeError: 'PropertyMap' instance has no attribute 'layers'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;at the ports_flc = FeatureLayerCollection.fromitem(ports_item) line. Have you gotten this error before?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 19:20:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261072#M50519</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-02-23T19:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Feature Layer Collection Properties</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261339#M50526</link>
      <description>&lt;P&gt;Is it possible you've got some other items with similar names that you're getting instead of your feature service?&amp;nbsp; That looks to me like an error you'd see if you were getting something like a File GDB item or a Survey123 form item instead of your feature layer item.&lt;/P&gt;&lt;P&gt;Try inserting this line before you call fromitem, it should say "Feature Service", if it says something else then you're grabbing the wrong item:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Assuming your item is referenced by "ports_item" like the sample
print(f"Item Type: {ports_item.type}")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 24 Feb 2023 09:09:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261339#M50526</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2023-02-24T09:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Feature Layer Collection Properties</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261349#M50527</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous User&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im not sure what you mean by alternative titles. Perhaps this is the 'name' property as shown below? If the item is a feature service, it will print the layers and tables within the service.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;groups = gis.groups.search()
for g in groups: # looping through groups
    content = g.content()
    print(content) # printing list of each group's content
    for c in content:
        print(c) # printing each group's content separately as an item, has type Feature Layer Collection
        print(c.title)
        print(c.name)
        print(c.type)
        ## if it is a feature service, print the names of layers and tables
        if c.type == "Feature Service":
            for lyr in c.layers:
                print(lyr.properties.name)
            for tbl in c.tables:
                print(tbl.properties.name)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can access any item properties using the below. Just remember that these are the ITEM properties only, if you wanted the properties of a Feature Layer Collection, Feature Layer, Table, or WebMap for examples, you need to access the properties of these as their own objects.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

agol = GIS("home")
item = agol.content.get("AGOL_ITEM_ID")

for prpty in item:
    print(prpty, item[prpty])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 10:05:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261349#M50527</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2023-02-24T10:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Feature Layer Collection Properties</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261568#M50532</link>
      <description>&lt;P&gt;Hi Clubdebambos, thanks for your reply! I was able to use the lyr.properties.name syntax to access my layer name. As for alternative title, I realized it was something my organization formatted in the description, I'm sorry for any confusion this caused. I can access both elements now and am using the .update() command to edit my description's alternative title. Thank you again for the help!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 19:22:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261568#M50532</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-02-24T19:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Feature Layer Collection Properties</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261572#M50533</link>
      <description>&lt;P&gt;Hi MobiusSnake, I can access the properties now. For the alternative title, I realized it was something my organization formatted into each item's description, I'm sorry for any confusion I caused. Thank you so much for all your help!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 19:25:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/accessing-feature-layer-collection-properties/m-p/1261572#M50533</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2023-02-24T19:25:44Z</dc:date>
    </item>
  </channel>
</rss>

