GenerateID

Title  Generate ID

Description

Creates an attribute rule to populate a unique ID on tables and feature classes.

Usage

          
Leverages database sequences for a unique id

License

Standard

Syntax

GenerateID (in_table, out_folder, field, create_seq, definition_method, {where_clause}, {builder_values}, {rec_set}, {coded_value_fields})

Parameter Explanation Data Type
in_table Dialog Reference

The table or feature class that will have the new rule applied.

GPTableView
out_folder Dialog Reference

The folder where the output CSV will be saved. The name of the file is taken from in_table.

DEFolder
field Field
create_seq Dialog Reference

Option to create the database sequences in the workspace. A python file with the arcpy calls is created in the output folder regardless of this option

GPBoolean
definition_method Dialog Reference

The method used to define the format of the ID.

  • Builder - Interactively define the ID format. This includes the SQL used to apply different formats and sequences per asset, as well as padding, prefix and suffix values.
  • Table - Input the ID formats from a table.
  • Coded Values - Generate an configuration entry and sequence per each combination of coded values from selected fields.

GPString
where_clause (Optional) Dialog Reference

SQL Expression to filter records. Only records that satisfy the query will be calculated.

GPSQLExpression
builder_values (Optional) Dialog Reference

Interactively define the ID format. This includes the sql used to apply different formats and sequences per asset, as well as padding, prefix and suffix values.

  • Filter SQL (Optional): A SQL expression used to determine if the sequence is applied to the row.
  • Description (Optional): A description of the entry that is added to the rule settings in the attribute rule.
  • Sequence Name (Required): The name you want to assign to the database sequence. For enterprise geodatabases, the name must meet sequence name requirements for the database platform you're using and must be unique in the database. For file geodatabases, the name must be unique to the file geodatabase.
  • Starting Value (Required): The starting number of the sequence. If you do not provide a starting number, the sequence starts with 1. If you do provide a starting number, it must be greater than 0.
  • Increment Value (Required): Describes how the sequence numbers will increment. For example, if the sequence starts at 10 and the increment value is 5, the next value in the sequence is 15, and the next value after that is 20. If you do not specify an increment value, sequence values will increment by 1.
  • Prefix (Optional): The string or value placed before the sequence value.
  • Suffix (Optional): The string or value placed after the sequence value.
  • Padding (Optional): A positive number that represents number of digits, where 0's are used to fill the unused digits. For example, a value of 5 will represent the sequence value of 1 as 00001.
  • Separator (Optional): The value used to join the prefix, sequence and suffix.

GPValueTable
rec_set (Optional) Dialog Reference

Input the ID formats from a table. Use the Helper-Field Combos to SQL tool to generate this tables and build out the sql combos

GPRecordSet
coded_value_fields (Optional) Dialog Reference

Use the distinct combinations of the coded values from the fields to generate a SQL expression and configuration for an ID.

Field

Code Samples