Feature type sort order in drop-down list

8840
15
Jump to solution
06-04-2015 06:05 PM
RandyBurton
MVP Alum

In a feature class, I have a field that controls the feature type and, therefore, the symbology.  This field uses a coded-value domain list that is carefully sorted.  I can get the legend to use the domain sorting without difficulty.  The difficulty in sorting comes with the drop-down menu in Collector where the user changes the feature type.   When I create a new feature and add it to a new ArcGIS on-line map, I end up having to go into the “Edit - Manage New Features” and reorder items to get the drop-down list in the same order as the legend - this can be tedious if there are many feature types. I have also used the REST API to reorder the types - this is quicker, but could create other problems.

Can this reordering be done in ArcMap when the feature class is created?

Tags (2)
0 Kudos
15 Replies
deleted-user-BBLVVi7Xg643
New Contributor II

Is it possible to simply edit the numbers listed beside each type in the json or how exactly do you reorder these?  My database has subtypes and its a huge pain to try and resort all of these in a text editor.  I can't resort these on ArcGIS Online either because my subypes are based on a file geodatabase table, rather than a feature class.  Any help would be appreciated....

0 Kudos
DavinShokes1
Occasional Contributor II

Try to make stage the sd file locally. Unzip it and edit the templates found within <sd file> / servicedescriptions / featureserver / featureserver.json

Then recompress the sd (you may need to change the extension back to .sd) and try to publish through ArcMap, Arcpy, or after uploading the .sd to your organization.

0 Kudos
deleted-user-BBLVVi7Xg643
New Contributor II

RTC GIS​ How do I uncompress and compress an .sd file?  I created a service definition file locally on my computer. 

0 Kudos
DavinShokes1
Occasional Contributor II

Using 7zip or WinRAR etc.  right click the .sd to get some options. You may be able to modify the json without uncompressing by replacing the .json file inside with the one you have modified.

0 Kudos
RandyBurton
MVP Alum

Matthew:

It might be possible to just renumber, but the numbers you would be changing are the coded values.  If you are thinking of editing the JSON file here are my suggestions.

Work with a copy of your data and back up your original.

Work with only sections of the JSON file.  There is a bug when making changes to the drawingInfo section; the contentType gets set to null.

Use jsonlint.com to check validity.

Since I have not used subtypes, I cannot advise on this point.

For the types section, copy this to a text editor. Enclose the section with curly brackets for valid JSON. I would probably move sections, but you may try renumbering if the types are fairly simple. There will be an ID which is the number you are thinking of changing.  There will be a related template section and you will see the same number there. The template section controls what happens when you change types. Values here that are null are inherited; other values may interact with subtypes.  You will also see your coded value in this section.

Again, test on a backup copy before changing your original data. Hope this helps.

0 Kudos
DavinShokes1
Occasional Contributor II

Randy Burton​, I have found some more out while testing.

1. I've extracted the featureserver.json from an sd file and confirmed the template order is wrong after staging is complete. Although I haven't checked, one may be able to sort the templates in the json, compress the sd file, and publish.

2. all "contentType" values are set to "" for esriPMS picture marker symbols everytime I programmatically update the service definition via REST. It occurs regardless of whether changes are made or not.

3. When managing templates through the map viewer I tried to pick a new image symbol for a templates. After saving, the "contentType" was set to "image/png".

4. While using the style and templates management panels in map viewer, I found that changing the symbol size and keeping the image did not update "contentType" to "image/png"

5. Map viewer doesn't care about "contentType" but Collector for ArcGIS offline does.

0 Kudos