Export Attribute Rules (Data Management)

Summary

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

Usage

  • 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, EXCLUDECLIENTEVALUATION, ISENABLED, BATCH, SEVERITY, TAGS, CATEGORY, and CHECKPARAMETERS.

    .csv columns

    ColumnsDescriptionExample

    NAME

    The name of the rule.

    constraintRuleOP

    DESCRIPTION

    The rule description

    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 is the subtype name to which the rule is applied.

    ALL

    FIELD

    The name of the field to which the rule is applied, if applicable.

    CONDITION

    ISEDITABLE

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

    True or False

    TRIGGERINSERT

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

    True or False

    TRIGGERDELETE

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

    True or False

    TRIGGERUPDATE

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

    True or False

    SCRIPTEXPRESSION

    The Arcade script expression that defines the rule.

    $feature.OPERATINGPRESSURE < 300

    ERRORNUMBER

    The error number for the rule, if applicable.

    99

    ERRORMESSAGE

    The error message for the rule, if applicable.

    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 or False

    ISENABLED

    A Boolean value that defines whether the attribute rule is enabled.

    True or False

    BATCH

    A Boolean value that defines whether the rule supports batch validation.

    True or False

    SEVERITY

    An integer value (1–5) that defines the severity of the error.

    2

    TAGS

    A set of string values that identify the rule.

    Operating pressure

    CATEGORY

    A system-generated integer value that defines the rule category, if applicable.

    This value is system generated and should not be modified.

    6

    CHECKPARAMETERS

    A system-generated JSON value that defines the configuration of a Data Reviewer-based rule.

    This value is system generated and should not be modified.

    {"ReviewerRuleType": "0", "minimumangle": "60"}

Syntax

ExportAttributeRules(in_table, out_csv_file)
ParameterExplanationData Type
in_table

The table or feature class from which the attribute rules will be exported.

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

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics