Iterate Field Values (ModelBuilder)

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

IterateFieldValues(in_table, field, {data_type}, {unique_values}, {skip_nulls}, {null_value})
ParameterExplanationData Type
in_table

The input table to be iterated over.

Table View
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, 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.

  • Address LocatorAddress Locator
  • Address Locator StyleAddress Locator Style
  • Analysis cell sizeAnalysis cell size
  • Any valueAny value
  • ArcMap DocumentArcMap Document
  • Areal unitAreal unit
  • BooleanBoolean
  • CAD Drawing DatasetCAD Drawing Dataset
  • Calculator ExpressionCalculator Expression
  • Catalog RootCatalog Root
  • Cell SizeCell Size
  • Cell Size XYCell Size XY
  • Composite LayerComposite Layer
  • CompressionCompression
  • Coordinate SystemCoordinate System
  • Coordinate Systems FolderCoordinate Systems Folder
  • CoverageCoverage
  • Coverage Feature ClassCoverage Feature Class
  • Data ElementData Element
  • Data FileData File
  • Database ConnectionsDatabase Connections
  • DatasetDataset
  • DateDate
  • dBASE TabledBASE Table
  • DecimateDecimate
  • Disk ConnectionDisk Connection
  • DoubleDouble
  • Encrypted StringEncrypted String
  • EnvelopeEnvelope
  • Evaluation ScaleEvaluation Scale
  • ExtentExtent
  • Extract ValuesExtract Values
  • Facility NetworkFacility Network
  • Feature ClassFeature Class
  • Feature DatasetFeature Dataset
  • Feature LayerFeature Layer
  • Feature SetFeature Set
  • FieldField
  • Field InfoField Info
  • Field MappingsField Mappings
  • FileFile
  • FolderFolder
  • Formulated RasterFormulated Raster
  • Fuzzy functionFuzzy function
  • GeoDataServerGeoDataServer
  • GeodatasetGeodataset
  • Geometric NetworkGeometric Network
  • Geostatistical LayerGeostatistical Layer
  • Geostatistical Search NeighborhoodGeostatistical Search Neighborhood
  • Geostatistical Value TableGeostatistical Value Table
  • GlobeServerGlobeServer
  • GPServerGPServer
  • GraphGraph
  • Graph Data TableGraph Data Table
  • Group LayerGroup Layer
  • Horizontal factorHorizontal factor
  • Image ServiceImage Service
  • IndexIndex
  • INFO ExpressionINFO Expression
  • INFO ItemINFO Item
  • INFO TableINFO Table
  • Internet Tiled LayerInternet Tiled Layer
  • LAS DatasetLAS Dataset
  • LAS Dataset LayerLAS Dataset Layer
  • LayerLayer
  • Layer FileLayer File
  • LineLine
  • Linear unitLinear unit
  • LongLong
  • M DomainM Domain
  • MapMap
  • Map Server LayerMap Server Layer
  • MapServerMapServer
  • Mosaic DatasetMosaic Dataset
  • Mosaic LayerMosaic Layer
  • NeighborhoodNeighborhood
  • Network Analyst Class FieldMapNetwork Analyst Class FieldMap
  • Network Analyst Hierarchy SettingsNetwork Analyst Hierarchy Settings
  • Network Analyst LayerNetwork Analyst Layer
  • Network DatasetNetwork Dataset
  • Network Dataset LayerNetwork Dataset Layer
  • Parcel FabricParcel Fabric
  • Parcel Fabric LayerParcel Fabric Layer
  • PointPoint
  • PolygonPolygon
  • Projection FileProjection File
  • PyramidPyramid
  • RadiusRadius
  • Random Number GeneratorRandom Number Generator
  • Raster BandRaster Band
  • Raster Calculator ExpressionRaster Calculator Expression
  • Raster CatalogRaster Catalog
  • Raster Catalog LayerRaster Catalog Layer
  • Raster Data LayerRaster Data Layer
  • Raster DatasetRaster Dataset
  • Raster LayerRaster Layer
  • Raster StatisticsRaster Statistics
  • Raster TypeRaster Type
  • Record SetRecord Set
  • Relationship ClassRelationship Class
  • RemapRemap
  • Route Measure Event PropertiesRoute Measure Event Properties
  • Schematic DatasetSchematic Dataset
  • Schematic DiagramSchematic Diagram
  • Schematic Diagram ClassSchematic Diagram Class
  • Schematic FolderSchematic Folder
  • Schematic LayerSchematic Layer
  • SemiVariogramSemiVariogram
  • ServerConnectionServerConnection
  • ShapefileShapefile
  • Spatial ReferenceSpatial Reference
  • SQL ExpressionSQL Expression
  • StringString
  • String HiddenString Hidden
  • TableTable
  • Table ViewTable View
  • Terrain LayerTerrain Layer
  • Text FileText File
  • Tile SizeTile Size
  • Time configurationTime configuration
  • Time unitTime unit
  • TINTIN
  • TIN LayerTIN Layer
  • ToolTool
  • ToolboxToolbox
  • Topo featuresTopo features
  • TopologyTopology
  • Topology LayerTopology Layer
  • Transformation functionTransformation function
  • VariantVariant
  • Vertical factorVertical factor
  • VPF CoverageVPF Coverage
  • VPF TableVPF Table
  • WCS CoverageWCS Coverage
  • Weighted Overlay TableWeighted Overlay Table
  • Weighted SumWeighted Sum
  • WMS MapWMS Map
  • WorkspaceWorkspace
  • XY DomainXY Domain
  • Z DomainZ Domain
String
unique_values
(Optional)

Specifies whether 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)

Specifies whether 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)

The null value to skip, such as -9999, Null, -1. The default values are "" for strings and "0" for numbers.

String

Derived Output

NameExplanationData Type
value

The field value returned by each iteration.

Any Value

Environments

This tool does not use any geoprocessing environments.

Licensing information

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