<?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 Alphabetically sort domain lists when over 500? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702050#M68668</link>
    <description>&lt;P&gt;I have a hosted feature layer that contains four layers, each with a field containing more than 500 domain values (invasive species). Is there any way to sort these domain lists alphabetically? Right now, managing the lists is very difficult, since dragging and dropping domain values between pages is extremely time-consuming and nearly impossible to do efficiently.&lt;/P&gt;</description>
    <pubDate>Thu, 14 May 2026 14:35:52 GMT</pubDate>
    <dc:creator>luckachi</dc:creator>
    <dc:date>2026-05-14T14:35:52Z</dc:date>
    <item>
      <title>Alphabetically sort domain lists when over 500?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702050#M68668</link>
      <description>&lt;P&gt;I have a hosted feature layer that contains four layers, each with a field containing more than 500 domain values (invasive species). Is there any way to sort these domain lists alphabetically? Right now, managing the lists is very difficult, since dragging and dropping domain values between pages is extremely time-consuming and nearly impossible to do efficiently.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2026 14:35:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702050#M68668</guid>
      <dc:creator>luckachi</dc:creator>
      <dc:date>2026-05-14T14:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetically sort domain lists when over 500?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702054#M68669</link>
      <description>&lt;P&gt;I don't think there's a GUI option for this, but I would probably approach this by modifying the JSON in the REST endpoint and copy/pasting between layers.&lt;BR /&gt;&lt;BR /&gt;You can do this directly in ArcGIS Online, but it's also quite easy to do with ArcGIS Assistant:&lt;BR /&gt;&lt;A href="https://assistant.esri-ps.com/" target="_blank"&gt;https://assistant.esri-ps.com/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2026 14:44:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702054#M68669</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2026-05-14T14:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetically sort domain lists when over 500?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702059#M68670</link>
      <description>&lt;P&gt;Hi Katie - I am assuming the domain list would show up somewhere in the JSON Editor in the ArcGIS Assistant?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2026 14:53:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702059#M68670</guid>
      <dc:creator>luckachi</dc:creator>
      <dc:date>2026-05-14T14:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetically sort domain lists when over 500?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702064#M68671</link>
      <description>&lt;P&gt;Yup! It's in the "Data" section of the feature layer's JSON. Ctrl + F is your friend, search for "domain" and the applicable section should be easy to locate.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-05-14 110021.jpg" style="width: 710px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152479i4D7941F4EB049027/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-05-14 110021.jpg" alt="Screenshot 2026-05-14 110021.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if you find yourself needing to work with JSON a lot, I've found this free online tool very helpful! (and there are tons of similar ones out there, I'm sure). Copy/paste the JSON into the text view and then you can navigate within "Tree" view to help make sense of it all.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://jsoneditoronline.org/" target="_blank"&gt;https://jsoneditoronline.org/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2026 15:04:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702064#M68671</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2026-05-14T15:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetically sort domain lists when over 500?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702087#M68673</link>
      <description>&lt;P&gt;Unfortunately none of the domains show up in the Assistant&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled-1.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152483iEEA02B4FB8A50F66/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled-1.jpg" alt="Untitled-1.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-05-14 112818.png" style="width: 271px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152484iE9FD7A21F308F419/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-05-14 112818.png" alt="Screenshot 2026-05-14 112818.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but I can see it in the&amp;nbsp;ArcGIS REST Services Directory. Unfortunately, this still requires me to go through the entire tree and manually cut/paste each species into the correct order.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="luckachi_1-1778772603793.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152485i8E88C9933CCFC7B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="luckachi_1-1778772603793.png" alt="luckachi_1-1778772603793.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2026 15:32:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702087#M68673</guid>
      <dc:creator>luckachi</dc:creator>
      <dc:date>2026-05-14T15:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetically sort domain lists when over 500?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702092#M68674</link>
      <description>&lt;P&gt;Honestly, this is one of the places where AI is the most useful/least controversial! haha. Ask ChatGPT to alphabetize the JSON list. Definitely do a thorough review, but still beats manually moving them all around yourself!&lt;BR /&gt;&lt;BR /&gt;As for the JSON not showing in ArcGIS Assistant for you....it might be related to how the layer was initially created and published. I seem to remember JSON structures being slightly different for features that were published from Pro vs. created in AGOL directly, but not 100% sure off the top of my head...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2026 15:38:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702092#M68674</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2026-05-14T15:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Alphabetically sort domain lists when over 500?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702205#M68680</link>
      <description>&lt;P&gt;Do you have access to Map or Pro?&amp;nbsp; There are tools in both to sort/export domain tables, just can't use it to update the hosted data.&lt;/P&gt;&lt;P&gt;I do this with arcpy and the python API if you have access to them.&amp;nbsp; Just need to get them into a sorted table with Code and Description.&amp;nbsp; Then I use the following code to get it into the correct format:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def CreateDict(fieldname,domainname):
    global update_dict
    update_dict = {"fields": [
       {
         "name": fieldname,
         "domain" :{"type" : "codedValue", "name" : domainname,
         "codedValues" :[
    {"name" : "Pathway", "code"  :  "Pathway"}
    ]}}]}
    

    infc = BASE + os.sep + 'domaintable'    # sorted table with domain Code and Desc.
    with arcpy.da.SearchCursor(infc, ["Code","Street"]) as cursor:
            for row in cursor:
                update_dict['fields'][0]['domain']['codedValues'] += [{"name" : row[0] , "code" :  row[1]}]&lt;/LI-CODE&gt;&lt;P&gt;In this case, I am adding "Pathway" as I need it in my list, but is not in the table and will be at the top of the domain list.&lt;BR /&gt;this will format the update_dict to the proper format, then I use the API to get the layer and update it.&lt;/P&gt;&lt;P&gt;Example Output for the proper format:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;update_dict = {"fields": [
    {
      "name": "Street", 
      "domain" :{"type" : "codedValue", "name" : "Streetnames",
      "codedValues" :[
{"name" : "Pathway", "code"  :  "Pathway"},
{"name" : "89 PR SE", "code"  :  "89 PR SE"},
{"name" : "952 PR SE", "code"  :  "952 PR SE"},
{"name" : "974 PR SE", "code"  :  "974 PR SE"},
{"name" : "9th St", "code"  :  "9th St"},
{"name" : "Aaron Dr", "code"  :  "Aaron Dr"},
{"name" : "Abbot St", "code"  :  "Abbot St"},
{"name" : "Abert Ave", "code"  :  "Abert Ave"},
{"name" : "Acacia Ave", "code"  :  "Acacia Ave"},
{"name" : "Ada St", "code"  :  "Ada St"},
{"name" : "Adair Ct", "code"  :  "Adair Ct"},
{"name" : "Adair Dr", "code"  :  "Adair Dr"},
{"name" : "Adams St", "code"  :  "Adams St"},
{"name" : "Addison St", "code"  :  "Addison St"},
{"name" : "NA", "code"  :  "NA"}
     
]}}]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;lyr = my_agol.content.get('xxxxxxItemIDxxxxxxxxx').layers[0]    # get the layer to update
update = lyr.manager.update_definition(update_dict)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;R_&lt;/P&gt;&lt;P&gt;PS, unless there is a need to have the code different that the description, would highly suggest you keep them the same (as in my example above, or&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/232739"&gt;@Katie_Clark&lt;/a&gt;'s example) as you will have better results with fewer issues in the future.&amp;nbsp; &amp;nbsp;Domains don't all work the same in each client.&amp;nbsp; sometimes it searches code, sometimes domain, sometimes displays one and not the other.&amp;nbsp; The only way for it to be 'bulletproof' is if they are both the same.&lt;/P&gt;</description>
      <pubDate>Thu, 14 May 2026 23:15:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/alphabetically-sort-domain-lists-when-over-500/m-p/1702205#M68680</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2026-05-14T23:15:24Z</dc:date>
    </item>
  </channel>
</rss>

