ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Table To Domain

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

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

Usage

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

  • Workspace domains can also be managed in ArcCatalog or the Catalog window. Domains can be created and modified through the Domains tab on the Database Properties dialog box.

Syntax

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

The database table from which to derive domain values.

Table View
code_field

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

Field
description_field

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

Field
in_workspace

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

Workspace
domain_name

The name of the domain to be created or updated.

String
domain_description
(Optional)

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

String
update_option
(Optional)

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

  • APPEND —Appends to the domain values from the database table.
  • REPLACE —Replaces the values in the domain with values from the database table.
String

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",
                                "code",
                                "descript",
                                "montgomery.gdb",
                                "diameters",
                                "Valid pipe diameters")
TableToDomain Example 2 (Stand-alone script)

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

# Name: TableToDomain.py
# 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)

Environments

  • Auto Commit
  • Current Workspace

Licensing information

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

Related topics

  • An overview of the Domains toolset
  • A quick tour of subtypes
  • A quick tour of attribute domains
  • Geoprocessing considerations for attribute domains

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal