Skip To Content

Sort Coded Value Domain

Summary

Sorts the code or description of a coded value domain in either ascending or descending order.

Usage

Syntax

SortCodedValueDomain_management (in_workspace, domain_name, sort_by, sort_order)
ParameterExplanationData Type
in_workspace

The geodatabase containing the domain to be sorted.

Workspace
domain_name

The name of the coded value domain to be sorted.

String
sort_by

Specifies whether the code or description will be used to sort the domain.

  • CODERecords are sorted based on the code value for the domain.
  • DESCRIPTIONRecords are sorted based on the description value for the domain.
String
sort_order

Specifies the direction the records will be sorted.

  • ASCENDINGRecords are sorted from low value to high value.
  • DESCENDINGRecords are sorted from high value to low value.
String

Code sample

Sort Coded Value Domain Example (Python Window)
import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.SortCodedValueDomain_management("montgomery.gdb", "material", "CODE", "ASCENDING")

Environments

Licensing information

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

Related topics