Iterate Row Selection (ModelBuilder)
Usage
-
This tool is intended for use in ModelBuilder and not in Python scripting.
-
Iterate Row Selection calls Make Table View to select a table record and creates two outputs: Selected Rows and Value. The output Selected Rows is a Table View and can be used as inputs to other geoprocessing tools that accept a Table View as input in ModelBuilder.
-
More than one group by field can be used for the selection. If one or more group by fields are selected, the number of iterations is determined by the number of unique combinations of the group by fields. For each iteration, the selection of the output feature layer is determined by the number of records that match the given combination of the group by fields. If more than one group by field is chosen, then the values are concatenated <field value1>_<field value2> in the output inline variable name. See an example below where two group fields: call type and the crime period are used. The output Value is Vandalism_Morning and so on for the other values.
-
If no group by field is chosen, the output value is the group by ObjectID field, and the selection is one record per selection.
-
The tool has two outputs: Output Selected Rows and group Value of the ObjectID field for selected features, which could be used as in-line variable %Value% in other tools.
-
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
Parameter | Explanation | Data Type |
in_table |
Input table containing records to iterate through. | Table View |
fields [[Field, Null Value],...] (Optional) |
Input field used to group the records for selection. Any number of input fields can be defined, resulting in a selection based on a unique combination of the fields. Define the null value for the field. By default, null values are included in the selection unless specified or the option to skip all null values is checked. The default values are "" for strings and "0" for numbers. | Value Table |
skip_nulls (Optional) |
Determines if null values in the grouping fields are skipped during selection.
| Boolean |