When publishing a service via GDB upload, I assumed feature layer order was determined by the alphanumeric sorting of GDB feature class names, but this does not seem to be the case. My GDB has 3 feature classes, a Point, and two Polygon feature classes. They are named:
"A" (Point)
"B" (Polygon)
"C" (Polygon)
When I upload the GDB to publish the service, the resulting layers are in B-C-A order. I want them to be in A-B-C order. How do I do that?
Solved! Go to Solution.
Thanks for providing further detail GB_MattPanunto_GISS.
I performed a number of tests and was able to reproduce the described behavior. The results suggest that while feature layers stored within a file geodatabase adhere to alphanumeric ordering, when published to ArcGIS Online as a hosted feature layer, the layers are listed according to the order they were created in. This is further highlighted in the attached images, where layer 'F' was created before layer 'E'.
Regards,
Thank you for your question. Can you please provide an image of the described issue?
It is expected that feature classes participating in a file geodatabase should be ordered alphanumerically. Have you double checked the names of each feature class to rule out the presence of any influencing factors (e.g. unexpected characters)?
Regards,
Here you go. The first image shows the GDB from within the Catalog Pane. While the second image shows the resulting service that is published by uploading this GDB to ArcGIS Online. There are no unexpected characters in the names of the GDB, or the feature classes.
1)
2)
Thanks for providing further detail GB_MattPanunto_GISS.
I performed a number of tests and was able to reproduce the described behavior. The results suggest that while feature layers stored within a file geodatabase adhere to alphanumeric ordering, when published to ArcGIS Online as a hosted feature layer, the layers are listed according to the order they were created in. This is further highlighted in the attached images, where layer 'F' was created before layer 'E'.
Regards,
Ahhh good sleuthing! Glad there is a way to resolve this issue. Can't help but wonder, is this working as intended?
Following additional testing using ArcGIS Enterprise 10.7.1, I was unable to reproduce these results. As such, the observed behavior may be limited to ArcGIS Online.
Regards,
Thank you for this. I would add that the order of the service indices is also the same as returned by arcpy.ListFeatureClasses() for Feature Layers, continued by arcpy.ListTables() for tables, and that finally tables that define M -> M relationships are listed in order they were created.