If Field Value Is (ModelBuilder)

Summary

Evaluates if the values in an attribute field match a specified value, expression, or second field.

Learn how If Field Value Is works in ModelBuilder

Usage

  • This tool is intended for use in ModelBuilder, not in Python scripting.

  • The tool has two Boolean outputs, True and False. Based on the condition being evaluated, one of the two Boolean outputs is true and the other is false after the tool runs. These Boolean outputs must be set as a precondition to the downstream tools for those to execute if either of the preconditions is true.

Syntax

arcpy.mb.FieldValueIsIfThenElse(in_data, where_clause, {invert_where_clause}, selection_condition, {count}, {count_min}, {count_max})
ParameterExplanationData Type
in_data

Input element to be evaluated.

Data Element; Layer; Table View; Raster Layer; Mosaic Layer; Graph; Utility Network
where_clause

An SQL expression used to select a subset of records. For more information on SQL syntax see SQL reference for query expressions used in ArcGIS.

SQL Expression
invert_where_clause
(Optional)

Specifies whether the expression will be used as is, or the opposite of the expression will be used.

  • NON_INVERTThe query will be used as is. This is the default.
  • INVERTThe opposite of the query will be used. If the selection_type parameter is used, the reversal of the selection occurs before it is combined with existing selections.
Boolean
selection_condition

The selection condition to use for the field values of the records matching the SQL expression.

  • EXISTSChecks if any records match the SQL expression. This is the default.
  • NO_SELECTIONChecks if none of the records match the SQL expression.
  • ALL_SELECTEDChecks if all of the records match the SQL expression.
  • IS_EQUAL_TOChecks if the number of records that match the SQL expression is equal to the Count value.
  • IS_BETWEENChecks if the number of records that match the SQL expression is between the Minimum Count value and Maximum Count value.
  • IS_LESS_THANChecks if the number of records that match the SQL expression is less than the Count value.
  • IS_GREATER_THANChecks if the number of records that match the SQL expression is greater than the Count value.
  • IS_NOT_EQUAL_TOChecks if the number of records that match the SQL expression is not equal to the Count value.
String
count
(Optional)

The integer count value.

Long
count_min
(Optional)

The minimum integer count value.

Long
count_max
(Optional)

The maximum integer count value.

Long

Derived Output

NameExplanationData Type
true

If the specified criteria evaluates to True, this parameter will be set to True.

Boolean
false

If the specified criteria evaluates to False, this parameter will be set to True.

Boolean

Environments

This tool does not use any geoprocessing environments.

Licensing information

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