<?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: Problem updating multiple fields with same domain definition in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657686#M11724</link>
    <description>&lt;P&gt;Thank you for the tip on&amp;nbsp;&lt;SPAN&gt;hasSharedDomains&amp;nbsp;and&amp;nbsp;supportsSharedDomains in the service definition. When i set them to true it worked &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;.&lt;BR /&gt;&lt;BR /&gt;I have tested on a hosted feature service with multiple layers with fields where they all share the same domain and it works.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Oct 2025 14:19:51 GMT</pubDate>
    <dc:creator>jsidborn</dc:creator>
    <dc:date>2025-10-14T14:19:51Z</dc:date>
    <item>
      <title>Problem updating multiple fields with same domain definition</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657385#M11714</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are having problems when we want to update the field defintion on a featurelayer that is hosted on a featureservice in ArcGIS Online. We want to update the domain definition on multiple fields that uses the same domain.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Domain defintion&lt;/STRONG&gt;&lt;/U&gt;:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"domain": {
				"type": "codedValue",
				"name": "YESNO",
				"mergePolicy": "esriMPTDefaultValue",
				"splitPolicy": "esriSPTDefaultValue",
				"codedValues": [
					{
						"name": "No",
						"code": "1"
					},
					{
						"name": "Yes",
						"code": "2"
					}
				]
			}&lt;/LI-CODE&gt;&lt;P&gt;This domain is used on multiple fields in a feature layer that is hosted in ArcGIS Online.&lt;/P&gt;&lt;P&gt;We call the update_definition in Python like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
import arcgis
import json

gis = GIS([AGOLURL], [USER], [PWD])
fs = arcgis.features.FeatureLayer([FeatureServiceURL], gis)
update_dict = json.loads(...json field defintion...)
check = fs.manager.update_definition(update_dict)&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;JSON field defintion:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"fields": [
		{
			"name": "field1",
			"domain": {
				"type": "codedValue",
				"name": "YESNO",
				"mergePolicy": "esriMPTDefaultValue",
				"splitPolicy": "esriSPTDefaultValue",
				"codedValues": [
					{
						"name": "No",
						"code": "1"
					},
					{
						"name": "Yes",
						"code": "2"
					}
				]
			}
		},
		{
			"name": "field2",
			"domain": {
				"type": "codedValue",
				"name": "YESNO",
				"mergePolicy": "esriMPTDefaultValue",
				"splitPolicy": "esriSPTDefaultValue",
				"codedValues": [
					{
						"name": "No",
						"code": "1"
					},
					{
						"name": "Yes",
						"code": "2"
					}
				]
			}
		},
		{
			"name": "field3",
			"domain": {
				"type": "codedValue",
				"name": "YESNO",
				"mergePolicy": "esriMPTDefaultValue",
				"splitPolicy": "esriSPTDefaultValue",
				"codedValues": [
					{
						"name": "No",
						"code": "1"
					},
					{
						"name": "Yes",
						"code": "2"
					}
				]
			}
		}
	]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The result from that call is SUCCESS and it updates all fields.&lt;/P&gt;&lt;P&gt;BUT the name of the domain for each field changes from what I except "YESNO" to field1_[number], field2_[number], and so on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have some input how to solve this? or if I am missing something. I have checked that we dont have missed out any fields in the feaure layer that uses the same domain.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;We have ArcGIS Pro 3.1.3 installed at the moment.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2025 11:51:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657385#M11714</guid>
      <dc:creator>jsidborn</dc:creator>
      <dc:date>2025-10-13T11:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem updating multiple fields with same domain definition</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657548#M11717</link>
      <description>&lt;P&gt;I've had the same experience. It seems that in ArcGIS Online, a field's domain is defined within the field's definition, meaning a domain only applies to that one field. You cannot re-use one domain across multiple fields in a hosted feature layer, like you might be used to doing in ArcGIS Pro, such as with a feature class in a file geodatabase.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Intriguingly, there are a couple JSON keys in a typical feature service definition, hasSharedDomains and&amp;nbsp;supportsSharedDomains, which might hint at the possibility of sharing domains across multiple fields? However, I have not found any documentation that describes how to use them.)&lt;/P&gt;</description>
      <pubDate>Mon, 13 Oct 2025 21:25:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657548#M11717</guid>
      <dc:creator>PeterKnoop</dc:creator>
      <dc:date>2025-10-13T21:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem updating multiple fields with same domain definition</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657614#M11720</link>
      <description>&lt;P&gt;One day these shared domains might come into fruition. For now, each domain for that layer must have a unique name, so AGOL is probably noticing that you are breaking that rule and renaming the domains for you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2025 08:45:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657614#M11720</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-10-14T08:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem updating multiple fields with same domain definition</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657686#M11724</link>
      <description>&lt;P&gt;Thank you for the tip on&amp;nbsp;&lt;SPAN&gt;hasSharedDomains&amp;nbsp;and&amp;nbsp;supportsSharedDomains in the service definition. When i set them to true it worked &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;.&lt;BR /&gt;&lt;BR /&gt;I have tested on a hosted feature service with multiple layers with fields where they all share the same domain and it works.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2025 14:19:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657686#M11724</guid>
      <dc:creator>jsidborn</dc:creator>
      <dc:date>2025-10-14T14:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem updating multiple fields with same domain definition</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657690#M11725</link>
      <description>&lt;UL&gt;&lt;LI&gt;This is nice to know. I have some workflows to update now &lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 14 Oct 2025 14:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/problem-updating-multiple-fields-with-same-domain/m-p/1657690#M11725</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-10-14T14:20:50Z</dc:date>
    </item>
  </channel>
</rss>

