Hi all, title says most of it.
We've built a tool in ModelBuilder to create a number of datasets for us that we then upload to our organization's AGOL account. That tool applies custom symbologies and creates specific fields that other people in our organization will use. Our tool has worked nicely for us, but we've added a new module that creates new feature classes (which we then add to a map from the output feature database, we'd love for these to add to the map automatically, but they don't, per a bug someone else has previously ID'd) we then want to upload those layers to AGOL using the "Share>Publish Web Layer" option on the whole group of new feature classes we've created.
The problem we're running into is that the display name for these new feature layers defaults to "Shape_Length" despite the fact that there are multiple other fields in the layer called "Project Name," "Label," etc. The ArcPro documentation here states that the display field is "By default, it is set to the first available string field in the feature layer containing the word name in the field name." This default behavior is not occurring and we do not know why.
Has anyone run into this issue before? Does anyone know how we can set in ModelBuilder or in the publish web layer menu the display name to not be "Shape_Length"?
To be clear, setting the display name individually in the layer properties is not an option, as we will be running this tool on hundreds of sites and do not have the bandwidth to set it all manually. Thanks!
So I believe this is BUG-000143180 - "ArcGIS Pro has to assign the Display field of a feature class in the same manner as ArcMap." Per the bug report:
One test to run is create a new feature class outside of the model - one without user attribute fields created - what does the Display Name default to? And another one with user defined attribute fields when creating the new feature class outside of the model. What does the Display name default to?
Hi @Robert_LeClair ,
This is interesting. Does this bug report imply that ArcGIS Pro should not be defaulting to shape_length field if there are no user attribute fields? circle back to https://community.esri.com/t5/arcgis-pro-ideas/make-display-field-default-to-objectid/idi-p/1350948
I tested a new polygon feature class with no attributes and the Display Field defaulted to Shape_Length in both so that's functional equivalency there. I think what should be done is the default display field to be ObjectID so it doesn't throw the error. Since ObjectID's are 32-bit, it would not cause an error publishing.
I would 100% agree. Thanks.