<?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: How do I know which properties an item has? in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539101#M10672</link>
    <description>&lt;P&gt;When in doubt, &lt;A href="https://docs.python.org/3/library/functions.html#dir" target="_self"&gt;dir&lt;/A&gt; is your friend!&lt;/P&gt;</description>
    <pubDate>Mon, 16 Sep 2024 19:30:05 GMT</pubDate>
    <dc:creator>DavidSolari</dc:creator>
    <dc:date>2024-09-16T19:30:05Z</dc:date>
    <item>
      <title>How do I know which properties an item has?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539096#M10671</link>
      <description>&lt;P&gt;This is a VERY general question, but it would be very helpful to get this figured out. Sometimes, when I enter "item.properties" I get nice list of properties. And sometimes, I get nothing. 'check_item' below is a feature service view. I wanted to know which properties I have access to and the 'properties' attribute says 'None.'&lt;/P&gt;&lt;LI-CODE lang="c"&gt;print(check_item.properties)&lt;/LI-CODE&gt;&lt;P&gt;None&lt;/P&gt;&lt;P&gt;There are many I know of: 'title' 'shared_with' 'snippet' etc... How does one acquire a list of the available properties of an item? jupyter does not seem to have autofill.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;R&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 19:20:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539096#M10671</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-09-16T19:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know which properties an item has?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539101#M10672</link>
      <description>&lt;P&gt;When in doubt, &lt;A href="https://docs.python.org/3/library/functions.html#dir" target="_self"&gt;dir&lt;/A&gt; is your friend!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 19:30:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539101#M10672</guid>
      <dc:creator>DavidSolari</dc:creator>
      <dc:date>2024-09-16T19:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know which properties an item has?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539303#M10676</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/719826"&gt;@RandyMcGregor_BMcD&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The documentation states that Item objects have a base of a dictionary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

## access ArcGIS Online
agol = GIS("home")

## get the Feature Service as an Item object
item = agol.content.get("ITEM_ID") 

## print each property name
for p in item.keys():
    print(p)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want to see the keys and values printed neatly...&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
import json

## access ArcGIS Online
agol = GIS("home")

## get the Feature Service as an Item object
item = agol.content.get("ITEM_ID") 

## print property name : value
print(json.dumps(item, indent=4))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As mention by&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/4413"&gt;@DavidSolari&lt;/a&gt;, you can use dir(), this will return beyond the item dictionary properties and include the class properties and methods amongst others.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

## access ArcGIS Online
agol = GIS("home")

## get the Feature Service as an Item object
item = agol.content.get("ITEM_ID") 

## dir() will return the dictionary properties, class properties and methods, dunder methods and properties
print(dir(item))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 08:32:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539303#M10676</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2024-09-17T08:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know which properties an item has?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539400#M10677</link>
      <description>&lt;P&gt;Thank you. I appreciate it. I'm going to fess up here. I find the documentation &lt;EM&gt;extremely&lt;/EM&gt; difficult to understand. I basically just hunt and use trial and error until something works. It's designed for coders of course and that's understandable. I wonder if there's a way people like me who work with notebooks and usually can get them to work to get background that would make the documentation more readable? It seems like a lot of scanning is required, few links...&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 12:17:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539400#M10677</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-09-17T12:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know which properties an item has?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539404#M10678</link>
      <description>&lt;P&gt;This works perfectly (Thank you!):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;from arcgis.gis import GIS

## access ArcGIS Online
agol = GIS("home")

## get the Feature Service as an Item object
item = agol.content.get("ITEM_ID") 

## print each property name
for p in item.keys():
    print(p)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This, using the same item id, does not:&lt;/P&gt;&lt;PRE&gt;from arcgis.gis import GIS
import json

## access ArcGIS Online
agol = GIS("home")

## get the Feature Service as an Item object
item = agol.content.get("ITEM_ID") 

## print property name : value
print(json.dumps(item, indent=4))&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RandyMcGregor_BMcD_0-1726576258138.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115259i3D38FD1BCD6AADDD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RandyMcGregor_BMcD_0-1726576258138.png" alt="RandyMcGregor_BMcD_0-1726576258138.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;for 'item' I entered a feature service view's item id.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 12:33:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-do-i-know-which-properties-an-item-has/m-p/1539404#M10678</guid>
      <dc:creator>RandyMcGregor_BMcD</dc:creator>
      <dc:date>2024-09-17T12:33:27Z</dc:date>
    </item>
  </channel>
</rss>

