If Data Exists (ModelBuilder)

Summary

Evaluates if the specified data exists.

Learn how If Data Exists 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:

    If Data Exists is always in a ready-to-run state (colored in) when added to a model. This is because the input is an optional Any Value data type, and an empty value is considered as valid input and evaluated as false. If the data type does not match the real data type of the input data, the False output variable will be set to true.

Syntax

arcpy.mb.DataExistsIfThenElse({in_data}, {data_type})
ParameterExplanationData Type
in_data
(Optional)

Input data element to be evaluated.

Any Value
data_type
(Optional)

The data type of the data element being evaluated. The only time you need to provide a value is when a geodatabase contains a feature dataset and a feature class or table with the same name. In this case, you need to select the data type (feature dataset, feature class or table) of the item you want to evaluate.

  • ANYAny Value. This is the default.
  • DEFeatureDatasetFeature Dataset
  • DEFeatureClassFeature Class
  • DETableTable
  • DEViewView
  • DERelationshipClassRelationship Class
  • DERasterDatasetRaster Dataset
  • DEMosaicDatasetMosaic Dataset
  • DEToolboxToolbox
  • DETopologyTopology
String

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