Continue in the app
Be The First To Get Support Updates
Want to know about the latest technical content and software updates?

How To: Calculate unique identifier values similar to Global IDs


Global ID and GUID data types store registry style strings consisting of 36 characters enclosed in curly brackets within a geodatabase. The values are normally used to track geodatabase replication; however, they can be used for other identification purposes.

The Global ID values are automatically updated when a feature is added to a geodatabase. In contrast, the GUID values must be managed manually. These values can be created through Python.


A unique identifier can be calculated using the UUID (Universally Unique Identifier) Python module. The resulting string value can be modified to match the same format as the Global ID by applying an uppercase function with the addition of curly brackets.

  1. Add a new field to the feature class. A GUID field type can only be added to a geodatabase feature class, and a text field type can be added to a shapefile.
    A text field requires a length of 38 characters to store the identifier, dashes, and brackets.
  2. Open the Field Calculator, choose the Python parser, and check the option to Show Codeblock.

    Pre-Logic Script Code:
    def ID():
      import uuid
      return '{' + str(uuid.uuid4()) + '}'


  3. The unique value is calculated for each row:


Related Information

Last Published: 7/29/2018

Article ID: 000011677

Software: ArcMap 10.1