<?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 to count records in web map layers in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/how-to-count-records-in-web-map-layers/m-p/1602969#M64312</link>
    <description>&lt;P&gt;This should accomplish what you're asking. It's not necessary to bring in the web map. Just use the direct feature service URL from the layer you are needing from your web map.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.features import FeatureLayer

# Connect to ArcGIS Online
gis = GIS("https://arcgis.com", "username", "password")

# Feature Service URL and Table Layer Index
# "https://services.arcgis.com/abc123/arcgis/rest/services/MyService/FeatureServer/1"
table_url = "Your feature service URL"

# Connect to the table
table = FeatureLayer(table_url)

# Count the number of records
record_count = table.query(where="1=1", return_count_only=True)

print(f"Total records in the table: {record_count}")&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Apr 2025 20:31:31 GMT</pubDate>
    <dc:creator>RyanUthoff</dc:creator>
    <dc:date>2025-04-04T20:31:31Z</dc:date>
    <item>
      <title>How to count records in web map layers</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-count-records-in-web-map-layers/m-p/1602964#M64310</link>
      <description>&lt;P&gt;Good afternoon&lt;/P&gt;&lt;P&gt;How can I&amp;nbsp; count records&amp;nbsp; in web map layers?&lt;/P&gt;&lt;P&gt;I want to count records in two layers from a web map. How can I do that?&lt;/P&gt;&lt;P&gt;# Open web map and layer&lt;BR /&gt;#&lt;BR /&gt;gis = GIS("Pro")&lt;BR /&gt;# Load the web map&lt;BR /&gt;webmap_item = gis.content.get("....")&lt;BR /&gt;# Load the web map&lt;BR /&gt;web_map = WebMap(webmap_item)&lt;/P&gt;&lt;P&gt;for layer in web_map.layers:&lt;BR /&gt;layer&lt;BR /&gt;print(layer.title)&lt;BR /&gt;# Query with return_count_only&lt;BR /&gt;# Get the layer as a FeatureLayer object&lt;BR /&gt;feature_layer =&amp;nbsp; ?????&lt;BR /&gt;# Count features&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 19:58:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-count-records-in-web-map-layers/m-p/1602964#M64310</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2025-04-04T19:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to count records in web map layers</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-count-records-in-web-map-layers/m-p/1602969#M64312</link>
      <description>&lt;P&gt;This should accomplish what you're asking. It's not necessary to bring in the web map. Just use the direct feature service URL from the layer you are needing from your web map.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.features import FeatureLayer

# Connect to ArcGIS Online
gis = GIS("https://arcgis.com", "username", "password")

# Feature Service URL and Table Layer Index
# "https://services.arcgis.com/abc123/arcgis/rest/services/MyService/FeatureServer/1"
table_url = "Your feature service URL"

# Connect to the table
table = FeatureLayer(table_url)

# Count the number of records
record_count = table.query(where="1=1", return_count_only=True)

print(f"Total records in the table: {record_count}")&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 20:31:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-count-records-in-web-map-layers/m-p/1602969#M64312</guid>
      <dc:creator>RyanUthoff</dc:creator>
      <dc:date>2025-04-04T20:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to count records in web map layers</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/how-to-count-records-in-web-map-layers/m-p/1603037#M64317</link>
      <description>&lt;P&gt;Suppose it depends where you want to see the record count. If in online, and in a pop-up, you can do this quite easily in Arcade.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Apr 2025 12:27:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/how-to-count-records-in-web-map-layers/m-p/1603037#M64317</guid>
      <dc:creator>JonathanMcD</dc:creator>
      <dc:date>2025-04-05T12:27:19Z</dc:date>
    </item>
  </channel>
</rss>

