Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The table below breaks down each of the six examples above into their component criteria, comparisons and the tests:

Rule

Criteria Field

Criteria Operator

Criteria Value

Test Field

Test Operator

Test Value

Comparison

Error Type

The field 'DBH' cannot have a value greater than '40'

NA

NA

NA

DBH

>

40

!=

Error

The field 'Net Acres' cannot have a value greater than the field 'Gross Acres'

NA

NA

NA

Net Acres

>

Gross_Acres

!=

Error

If the field 'Tree Type' has a value equal to 'Overstory', then the field 'DBH' cannot have a value less than '5'

Tree_Type

=

Overstory

DBH

<

5

!=

Error

If the field 'Component' has the value 'Live', then the field 'Snag Class' cannot have a value that is not equal to Null

Component

=

Live

Snag Class

!=

Null

!=

Error

If the fields 'DBH' and 'Height' both have a value not equal to 'Null', then the field 'Tally Measure' cannot have a value equal to 'T'

DBH, Height

!=

Null

Tally_Measure

=

T

!=

Error

The field 'DBH' cannot have a value greater than '20'; If it does warn the user but don't prevent saving the feature

NA

NA

NA

DBH

>

20

!=

Warning

Managing Validation Rules

...

  • If using table capabilities of ArcMap, ArcGIS Pro, or ArcGIS Online. Example rule: If the field 'Tree Type' has a value equal to 'Overstory', then the field 'DBH' cannot have a value less than '5'

    1. Generate a table named Rules using either ArcMap, ArcGIS Pro, ArcGIS Online.  See the image below for the full data model of the Rules table. MB&G WSG can provide a sample File Geodatabase with this data model upon request. Each row in the table defines one rule. "LEFT" inputs, aggregators, and operators correspond to the criteria portion of the rule.  "RIGHT" inputs, aggregators, and operators correspond to the test portion of the rule.  The "MAIN_OPERATOR" corresponds to the comparison portion of the rule.

    2. Define the criteria that must be met prior to applying the test by attributing the "LEFT" attributes of the Rules table.  In the example above, the test should only be applied if the field 'Tree Type' has a value equal to 'Overstory'. If the field 'Tree Type' is null or has a value that is not equal to 'Overstory', the test portion of the rule will not be assessed.

      • If a criteria is needed:

        • LEFT_INPUT1 - Enter field name within curly brackets { } (e.g., '{Tree_Type}' without the quotes. If more than one field is needed, separate the field names using comas (e.g., '{DBH},{Height}' without the quotes). 

        • LEFT_AGGREGATOR1 - Enter 'Value' in this field if one field is used as the LEFT_INPUT1 field.  Other options include 'Sum' to sum the values in multiple fields listed in the LEFT_INPUT1 field.

        • LEFT_OPERATOR - Enter the appropriate operator (=, !=, >,>=, <,<=)

        • LEFT_INPUT2 - Enter the text or number in the input.  If the criteria value is null, enter as 'Null' (without quotes).  If the value is coming from a field, enter in the field within curly brackets { } (e.g., '{Overstory}' without the quotes

        • LEFT_AGGREGATOR2 - Enter 'Value' if one field or a number or a text is used as the LEFT_INPUT2 field.

      • If no criteria is needed because the test should always be applied (see examples 1, 2 and 6 above):

        • LEFT_INPUT1 - Enter '1'

        • LEFT_AGGREGATOR1 - Enter 'Value'

        • LEFT_OPERATOR - Select '='

        • LEFT_INPUT2 - Enter '1'

        • LEFT_AGGREGATOR2 - Enter 'Value'

    3. Select the test inputs

      • RIGHT_INPUT1 - Enter the field name within curly brackets { } (e.g., '{DBH}' without the quotes). If more than one field is needed, separate the field names using comas (e.g., '{DBH},{Height}' without the quotes). 

      • RIGHT_AGGREGATOR1 - Enter 'Value' from the dropdown list for the field or 'Sum' if multiple fields are listed.

      • RIGHT_OPERATOR - Enter the appropriate operator (=, !=, >,>=, <,<=)

      • RIGHT_INPUT2 - Enter the text or number in the input.  If the criteria value is null, enter as 'Null' (without quotes).  If the value is coming from a field, enter in the field within curly brackets { } (e.g., '{DBH}' without the quotes

      • RIGHT_AGGREGATOR2 - Enter 'Value' from the dropdown list for the field or 'Sum' if multiple fields are listed.

    4. Select the Comparison

      • MAIN_OPERATOR - Enter '!='

    5. Select the error type

      • ERROR_TYPE - Enter 'Error' or 'Warning' from the dropdown list

    6. Enter the error (or warning) message to display to the user

      • ERROR_MESSAGE - Enter the full message that should be displayed to the user if the features does not pass the validation rule

...

Example rule: If the field 'Tree Type' has a value equal to 'Overstory', then the field 'DBH' cannot have a value less than '5'

Criteria

LEFT_INPUT1

LEFT_AGGREGATOR1

LEFT_OPERATOR

LEFT_INPUT2

LEFT_AGGREGATOR2

{Tree_Type}

Value

=

{Overstory}

Value

Test

RIGHT_INPUT1

RIGHT_AGGREGATOR1

RIGHT_OPERATOR

RIGHT_INPUT2

RIGHT_AGGREGATOR2

 {DBH}

Value

<

5

Value

Comparision and Error Type

MAIN_OPERATOR

ERROR_TYPE

ERROR_MESSAGE

!=

Error

Overstory trees cannot have a DBH less than 5

Complete Rules Data Model

The full data model for the Rules table is shown in the image below.  MB&G can provide a sample File Geodatabase with this data model upon request.

...

The full data model for the Related_Domains table is shown in the image below.  MB&G WSG can provide a sample File Geodatabase with this data model upon request.

...