ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS 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
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Sort Coded Value Domain

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

Summary

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

Usage

  • Only supports sorting coded value domains stored in version 10.0 and later geodatabases.

Syntax

arcpy.management.SortCodedValueDomain(in_workspace, domain_name, sort_by, sort_order)
ParameterExplanationData Type
in_workspace

The geodatabase containing the domain to be sorted. Must be a version 10.0 geodatabase or later.

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.

  • CODE —Records are sorted based on the code value for the domain.
  • DESCRIPTION —Records are sorted based on the description value for the domain.
String
sort_order

Specifies the direction the records will be sorted.

  • ASCENDING —Records are sorted from low value to high value.
  • DESCENDING —Records are sorted from high value to low value.
String

Derived Output

NameExplanationData Type
out_workspace

The updated input workspace.

Workspace

Code sample

SortCodedValueDomain example (Python window)

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

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.SortCodedValueDomain_management("montgomery.gdb", "material", "CODE", "ASCENDING")

Environments

  • Current Workspace

Licensing information

  • Basic: Yes
  • Standard: Yes
  • 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 Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal