ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Iterate Field Values

  • Summary
  • Usage
  • Syntax
  • Environments
  • Licensing information

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.

  • 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

arcpy.mb.IterateFieldValues(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

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics

  • An overview of the Iterator toolset
  • A quick tour of using iterators

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal