Skip To Content

Table To Domain


Creates or updates a coded value domain with values from a table.


  • A domain can also be created with the Create Domain tool.

  • The standard delimiter for tabular text files with extensions .csv or .txt is a comma, and for files with a .tab extension, a tab. To use an input table with a nonstandard delimiter, you must first specify the correct delimiter used in the table using a schema.ini file.


TableToDomain_management (in_table, code_field, description_field, in_workspace, domain_name, {domain_description}, {update_option})
ParameterExplanationData Type

The database table from which to derive domain values.

Table View

The field in the database table from which to derive domain code values.


The field in the database table from which to derive domain description values.


The workspace that contains the domain to be created or updated.


The name of the domain to be created or updated.


The description of the domain to be created or updated. Domain descriptions of existing domains are not updated.


If the domain already exists, specifies how the domain will be updated.

  • APPENDAppends to the domain values from the database table.
  • REPLACEReplaces the values in the domain with values from the database table.

Code sample

TableToDomain Example (Python Window)

The following Python window script demonstrates how to use the TableToDomain function in immediate mode.

import arcpy
from arcpy import env
env.workspace =  "C:/data"
arcpy.TableToDomain_management ("diameter.dbf",
                                "Valid pipe diameters")
TableToDomain Example 2 (Stand-alone script)

This stand-alone script uses the TableToDomain function as part of a workflow.

# Name:
# Description: Update an attribute domain to constrain valid pipe material values

# Import system modules
import arcpy
# Set the workspace (to avoid having to type in the full path to the data every time)
arcpy.env.workspace = "C:/data"

#Set local parameters
domTable = "diameter.dbf"
codeField = "code"
descField = "descript"
dWorkspace = "Montgomery.gdb"
domName = "diameters"
domDesc = "Valid pipe diameters"

# Process: Create a domain from an existing table
arcpy.TableToDomain_management(domTable, codeField, descField, dWorkspace, domName, domDesc)

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes

Related topics