<?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>idea enable query_domains() for ArcGIS Online Hosted Feature Services in ArcGIS API for Python Ideas</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/enable-query-domains-for-arcgis-online-hosted/idi-p/1384809</link>
    <description>&lt;P&gt;Currently, when using query_domain() on a hosted feature layer you are returned and empty list (which is an improvement on previous versions where it caused an error)&lt;/P&gt;&lt;P&gt;It would be fantastic if this nice little function would work for hosted feature layers. I had reported as a &lt;A href="https://github.com/Esri/arcgis-python-api/issues/1760" target="_blank" rel="noopener"&gt;bug &lt;/A&gt;but it seems this is by design, it is a function for enterprise services, why only enterprise? AGOL users need it too.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS
from arcgis.features import FeatureLayerCollection

## connect to agol
agol = GIS("home")

## get feature service as an item object
item = agol.content.get("FS_ITEM_ID")

## create a flc object from item object
flc = FeatureLayerCollection(item.url, agol)

## use the query_domains() method on the layer(s) of choice
domains = flc.query_domains(layers=[0])

print(domains)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2024 10:53:12 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2024-02-21T10:53:12Z</dc:date>
    <item>
      <title>enable query_domains() for ArcGIS Online Hosted Feature Services</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/enable-query-domains-for-arcgis-online-hosted/idi-p/1384809</link>
      <description>&lt;P&gt;Currently, when using query_domain() on a hosted feature layer you are returned and empty list (which is an improvement on previous versions where it caused an error)&lt;/P&gt;&lt;P&gt;It would be fantastic if this nice little function would work for hosted feature layers. I had reported as a &lt;A href="https://github.com/Esri/arcgis-python-api/issues/1760" target="_blank" rel="noopener"&gt;bug &lt;/A&gt;but it seems this is by design, it is a function for enterprise services, why only enterprise? AGOL users need it too.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS
from arcgis.features import FeatureLayerCollection

## connect to agol
agol = GIS("home")

## get feature service as an item object
item = agol.content.get("FS_ITEM_ID")

## create a flc object from item object
flc = FeatureLayerCollection(item.url, agol)

## use the query_domains() method on the layer(s) of choice
domains = flc.query_domains(layers=[0])

print(domains)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 10:53:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/enable-query-domains-for-arcgis-online-hosted/idi-p/1384809</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2024-02-21T10:53:12Z</dc:date>
    </item>
  </channel>
</rss>

