Skip To Content

Export Attribute Rules

Summary

Export attribute rules from a dataset to a comma-separated values (.csv) file.

Usage

  • Attribute rules are only supported on enterprise geodatabase datasets.

  • This tool can be used in conjunction with the Import Attribute Rules tool.

  • The .csv file includes the following columns: NAME, DESCRIPTION, TYPE, SUBTYPE, FIELD, ISEDITABLE, TRIGGERINSERT, TRIGGERDELETE, TRIGGERUPDATE, SCRIPTEXPRESSION, ERRORNUMBER, ERRORMESSAGE, and EXCLUDECLIENTEVALUATION.

    .csv columns

    ColumnsDescriptionExample

    NAME

    The name of the rule.

    constraintRuleOP

    DESCRIPTION

    The description that was provided for the rule.

    Operating pressure must be less than 300.

    TYPE

    The type of attribute rule.

    CONSTRAINT, CALCULATION

    SUBTYPE

    If the dataset has subtypes and the subtype is used in the rule definition, this will be the subtype name that the rule is applied to.

    ALL

    FIELD

    If applicable, the name of the field the rule is applied to.

    CONDITION

    ISEDITABLE

    A Boolean value that defines whether the attribute field is editable or not.

    True, False

    TRIGGERINSERT

    A Boolean value that defines whether the triggering events for the rule are set for insert edits or not.

    True, False

    TRIGGERDELETE

    A Boolean value that defines whether the triggering events for the rule are set for delete edits or not.

    True, False

    TRIGGERUPDATE

    A Boolean value that defines whether the triggering events for the rule are set for update edits or not.

    True, False

    SCRIPTEXPRESSION

    The Arcade script expression that defines the rule.

    $feature.OPERATINGPRESSURE < 300

    ERRORNUMBER

    If applicable, the error number for the rule.

    99

    ERRORMESSAGE

    If applicable, the error message for the rule.

    Invalid operating pressure. Must be less than 300.

    EXCLUDECLIENTEVALUATION

    A Boolean value that defines whether the rule will be supported for all clients or simple clients.

    True, False

Syntax

ExportAttributeRules_management (in_table, out_csv_file)
ParameterExplanationData Type
in_table

The table or feature class to export attribute rules from.

Table View
out_csv_file

The folder location and name of the .csv file to be created.

File

Code sample

ExportAttributeRules example (Python window)

Export the attribute rules from a feature class named GasPipes.

import arcpy
arcpy.ExportAttributeRules_management("C:\\MyProject\\MyDatabase.sde\\pro.USER1.GasPipes", 
                                      "C:\\MyProject\\ExpAttrRulesFrBuilding.csv")

Environments

Licensing information

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

Related topics