Skip To Content

Iterate Field Values

Summary

Iterates over each value in a field.

Learn how Iterate Field Values works in ModelBuilder

Usage

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

  • The output of the tool is a variable named Value and contains the value of the field. This variable can be used in for inline variable substitution (%Value%).

  • The Data Type parameter specifies the data type of the output variable. The default data type is string, but depending on how the output will be used in the model, different data types may be specified. For example, if your field contains the path to a feature class, you can set the Data Type to Feature Class and use the output variable as input to a tool that accepts a feature class.

Syntax

IterateFieldValues_mb (in_table, field, {data_type}, {unique_values}, {skip_nulls}, {null_value})
ParameterExplanationData Type
in_table

Input table that will be iterated over.

Table View
field

Input field for iteration.

Field
data_type
(Optional)

The data type of the output value. The default data type is String, but depending on how the output will be used in the model, different data types may be specified. For example, if your field contains the path to a feature class, you can set the Data Type to Feature Class and use the output variable as input to a tool that accepts a feature class.

String
unique_values
(Optional)

Determines if iteration values will be based on unique values.

  • Checked—The iteration values will be based on the unique value of the specified field.
  • Unchecked—The iteration will run for each record in the input table.
Boolean
skip_nulls
(Optional)

Determines if null values in the field will be skipped.

  • Checked—Will skip through all the null values in the field during selection.
  • Unchecked—Will include all the null values in the field during selection.
Boolean
null_value
(Optional)

Specify the Null Value to skip, such as -9999, Null, -1. The default values are "" for strings and "0" for numbers.

String

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • ArcGIS Desktop Basic: Yes
  • ArcGIS Desktop Standard: Yes
  • ArcGIS Desktop Advanced: Yes