<?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: Cannot add/delete field or edit domains in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/cannot-add-delete-field-or-edit-domains/m-p/1205949#M47566</link>
    <description>&lt;P&gt;It's the main feature layer...a non-spatial sublayer within the feature layer. Not a view.&lt;/P&gt;&lt;P&gt;That's a good thought on editing the JSON. I do I go about doing that? I just checked it out on the ago-assistant, but the domains are not exposed.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2022 17:16:41 GMT</pubDate>
    <dc:creator>PaulPetersen1</dc:creator>
    <dc:date>2022-08-24T17:16:41Z</dc:date>
    <item>
      <title>Cannot add/delete field or edit domains</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/cannot-add-delete-field-or-edit-domains/m-p/1205902#M47564</link>
      <description>&lt;P&gt;I've got a hosted feature layer in which I am the owner. I'd like to edit one of the domains to one of the tables, but when I click in the "Data--&amp;gt;Fields" tab,k and then select the field of interest, I am not given any option to edit the domain. I also noticed that I cannot add or remove attribute fields.&lt;/P&gt;&lt;P&gt;Usually I am able to do this in AGO without issue, so I'm a little baffled. The service is being used in a webmap and dashboard app, and also as an embedded Survey123 form in the dashboard app. I do have one of the tables participating in hosted (join) view, but not the table that I'm trying to edit.&lt;/P&gt;&lt;P&gt;See screenshot below for current feature layer setting. Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PaulPetersen1_0-1661356229542.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/49315iD7984BDE9E2E650B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PaulPetersen1_0-1661356229542.png" alt="PaulPetersen1_0-1661356229542.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 15:52:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/cannot-add-delete-field-or-edit-domains/m-p/1205902#M47564</guid>
      <dc:creator>PaulPetersen1</dc:creator>
      <dc:date>2022-08-24T15:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add/delete field or edit domains</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/cannot-add-delete-field-or-edit-domains/m-p/1205917#M47565</link>
      <description>&lt;P&gt;Editing domains can be tricky. Are you trying to apply this to the main layer, or a view that was created?&lt;/P&gt;&lt;P&gt;For some of my hosted layers, I've only been able to edit the domain by editing the JSON directly, which can be a bit more advanced.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 16:08:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/cannot-add-delete-field-or-edit-domains/m-p/1205917#M47565</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-08-24T16:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add/delete field or edit domains</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/cannot-add-delete-field-or-edit-domains/m-p/1205949#M47566</link>
      <description>&lt;P&gt;It's the main feature layer...a non-spatial sublayer within the feature layer. Not a view.&lt;/P&gt;&lt;P&gt;That's a good thought on editing the JSON. I do I go about doing that? I just checked it out on the ago-assistant, but the domains are not exposed.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 17:16:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/cannot-add-delete-field-or-edit-domains/m-p/1205949#M47566</guid>
      <dc:creator>PaulPetersen1</dc:creator>
      <dc:date>2022-08-24T17:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add/delete field or edit domains</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/cannot-add-delete-field-or-edit-domains/m-p/1205961#M47567</link>
      <description>&lt;P&gt;I forgot to ask: is this on Portal, or AGOL? On Portal, you can use the Server Admin tool. Otherwise, you'll have to use something like the Python API.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# connect to portal
from arcgis import GIS
gis = GIS('your portal url', 'user')

# get featurelayer
fl = gis.content.get('itemid of your service').layers[0]

# pull out layer's json for your fields
json = fl.properties['fields']

# you'll need your field's index here.
# if you don't know it, you can get a list of field names and their respective indices first
# print({x['name']:json.index(x) for (x) in json}
# let's just pretend yours is at index 5

# append new code / value to domain
json[5]['domain']['codedValues'].append({'code':'newcode', 'name':'newname'})

# apply updated json to service
fs.manager.update_definition({'fields':json})&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 24 Aug 2022 17:29:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/cannot-add-delete-field-or-edit-domains/m-p/1205961#M47567</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-08-24T17:29:35Z</dc:date>
    </item>
  </channel>
</rss>

