Summary
Iterates over each value in a field.
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 in-line 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.
If an Iterator is added to a model, all tools in the model iterate for each value in the iterator. If you do not want to run each tool in the model for each iterated value, create a sub-model/model within a model/nested model that contains only the iterator and add it as a model tool into the main model.
Syntax
IterateFieldValues_mb (in_table, field, {data_type}, {unique_values}, {skip_nulls}, {null_value})
Parameter | Explanation | Data 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.
| Boolean |
skip_nulls (Optional) | Determines if null values in the field will be skipped.
| 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 for Desktop Basic: Yes
- ArcGIS for Desktop Standard: Yes
- ArcGIS for Desktop Advanced: Yes