Skip To Content

Iterate Row Selection

Summary

Iterates over rows in a table.

Learn how Iterate Row Selection works in 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 Crime_Peri (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: Selected Rows and group Value of the ObjectID field for selected features, which could be used as inline variable %Value% in other tools.

Syntax

IterateRowSelection_mb (in_table, {fields}, {skip_nulls})
ParameterExplanationData Type
in_table

Table containing records to iterate through.

Table View
fields
[[Field, Null Value],...]
(Optional)

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.

  • Checked—Skip through all the null values in the grouping fields during selection.
  • Unchecked— Include all the null values in the grouping fields during selection.
Boolean

Environments

This tool does not use any geoprocessing environments.

Licensing information

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