Select to view content in your preferred language

Creating Lowercase "globalid" Fields

116
2
Thursday
Labels (3)
VinceE
by
Frequent Contributor

Hey folks, I have a need to create a lowercase "GlobalID" type field in a feature class. Until now, I was not aware of a way to do this, so I'm just curious if anyone else has this need and what their workaround was. The solution I have found seems to be undocumented. Hopefully Esri will chime in.

Geoprocessing Tool "Add Global IDs" does not allow customizing the name of this field. Neither does the check box in the Properties setting for a Feature Class. Neither does the arcpy call--the only parameter is the feature class name or path. Alter Field doesn't seem to allow this either on GlobalID type fields.

Add Field does allow customizing the field name (obviously), however the documentation does NOT include "GlobalID" as a valid argument for the "field_type" parameter (Python as well as the toolbox GUI drop down).

Despite that, this works fine:

arcpy.management.AddField(in_table="my_feature_class", field_name="globalid", field_type="GlobalID")

and results in: 

VinceE_0-1783629930417.png

0 Kudos
2 Replies
DavidSolari
MVP Regular Contributor

This doesn't answer your question per-se, but I'm curious: are you trying to create a feature class that'll eventually link up to Survey123? If so you don't have to lowercase your Object ID or Global ID fields, Survey123 can handle those fields regardless of case. You can even bind to them as form questions, despite the case warning in the Excel workbook.

VinceE
by
Frequent Contributor

This is interesting, and you've got it exactly right. This pertains to Survey123, but I'll have to pass this information onto a colleague, as I don't know the specifics. This could make the whole thing moot, so thanks a ton!

0 Kudos