If Value Is (ModelBuilder)

Summary

Evaluates an input value compared to a single value, a list of values, or a range of values using a defined comparison operator.

Learn how If 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.

  • Note:

    Most tools in ArcGIS are empty (without color) when added to a model; however, the If Value Is, If Data Exists, Collect Values, and Merge Branch tools are not. The If Value Is tool is always in a ready-to-run state (with color). This is because the input to the tool can be empty, which is considered a valid input for the comparison.

Syntax

arcpy.mb.ValueIsIfThenElse({input_value}, {value_test}, {comparison_type}, {values}, {range_values}, {comparison_value})
ParameterExplanationData Type
input_value
(Optional)

The input value to evaluate.

Any Value
value_test
(Optional)

Specifies the type of comparison operator to use.

  • IS_EQUAL_TO_ANYDetermine whether the input value is equal to any one of the comparison values. This is the default.
  • IS_NOT_EQUAL_TO_ANYDetermine whether the input value is not equal to any one of the comparison values.
  • IS_NOT_EQUAL_TO_ALLDetermine whether the input value is not equal to every comparison value.
  • IS_BETWEEN_ANYDetermine whether the input value is between any one range of comparison values.
  • IS_NOT_BETWEEN_ANY Determine whether the input value is not between any range of comparison values.
  • IS_LESS_THANDetermine whether the input value is less than the comparison value.
  • IS_GREATER_THANDetermine whether the input value is greater than the comparison value.
  • IS_LESS_THAN_OR_EQUALDetermine whether the input value is less than or equal to the comparison value.
  • IS_GREATER_THAN_OR_EQUALDetermine whether the input value is greater than or equal to the comparison value.
  • IS_EMPTYDetermine whether the input value is empty.
String
comparison_type
(Optional)

Specifies the type of data comparison to use.

  • STRING_CASE_INSENSITIVEThe input value is compared to the comparison values as a case insensitive string. This is the default.
  • STRING_CASE_SENSITIVEThe input value is compared to the comparison values as a case sensitive string.
  • LONGThe input numeric value is compared to the comparison values as a Long type.
  • DOUBLE The input numeric value is compared to the comparison values as a Double type.
  • AUTOThe input data type is checked and an equivalent data type comparison is performed. For example, compare the input and comparison values using string comparison for string type, long for long, and double for double. All other input data types use the default string comparison method.
String
values
[values,...]
(Optional)

The list of values to compare to the input value.

Any Value
range_values
[[Any Value, Any Value],...]
(Optional)

Specifies the range values to compare to the input value.

  • Minimum—The input value is compared to the minimum value in the range.
  • Maximum—The input value is compared to the maximum value in the range.
Value Table
comparison_value
(Optional)

The single value to compare to the input value.

Any Value

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