Usage
This tool is intended for use in ModelBuilder, 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 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, other data types can be specified. For example, if your field contains the path to a feature class, you can set the Data Type parameter 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 submodel, model within a model, or nested model that contains only the iterator and add it as a model tool to the main model.
Syntax
arcpy.mb.IterateFieldValues(in_table, field, {data_type}, {unique_values}, {skip_nulls}, {null_value})
Parameter | Explanation | Data Type |
in_table | The input table to be iterated. | Table View; Raster Layer |
field | The input field for iteration. | Field |
data_type (Optional) | Specifies 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, other data types can be specified. For example, if your field contains the path to a feature class, you can set this parameter to Feature Class and use the output variable as input to a tool that accepts a feature class.
| String |
unique_values (Optional) | Specifies whether iteration values will be based on unique values.
| Boolean |
skip_nulls (Optional) | Specifies whether null values in the field will be skipped.
| Boolean |
null_value (Optional) | The null value to skip, such as -9999, Null, or -1. The default values are "" for strings and "0" for numbers. | String |
Derived Output
Name | Explanation | Data Type |
value | The field value returned by each iteration. | Any Value |
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes