Collect Values (ModelBuilder)

Summary

Collects output values from an iterator or converts a list of values into a single input. The output of Collect Values can be used as input to the Merge, Append, Mosaic, and Cell Statistics tools.

Learn how Collect Values works in ModelBuilder

Usage

  • This tool is intended for use in ModelBuilder and not in Python scripting.

  • Note:

    Most tools in ArcGIS are empty (without color) when added to a model; however, the Collect Values, If Value Is, If Data Exists, and Merge Branch tools are not. Unlike most tools, the Collect Values tool is always in a ready-to-run state (with color). This is because the input to the tool can be empty, which is considered a valid input.

  • Tool outputs that are model parameters are added to the map display using the variable name. If you are using an iterator in the model and want to add the outputs of all the iterations to display in the map with the actual unique output name instead of the name of the variable, connect the output to be displayed to the Collect Value tool, right-click the output of Collect Value, and make it a model parameter.

  • Another use of the Collect Values tool is for removing output parameters from the tool dialog box and still have the output added to the display. For example, suppose your model uses the Buffer tool, and the output of the Buffer tool is a model parameter. When you run your model from its tool dialog box, the tool dialog box displays this parameter, and the user of your dialog box can change the location where the output of Buffer is written. But maybe you don't want the user of your dialog box to change this location; that is, you want to write it to a specific location a user can't change.

    In this type of case, change the output of Buffer so it is not a parameter and connect the output to the Collect Values tool. Then make the output of Collect Values a model parameter. When the model is run from the tool dialog box, the parameter does not display in the dialog box and the user can't change it. Yet, because it's an output parameter, it is added to the map. (This works because, technically, the output of Collect Values is of type in-out derived data, and in-out derived data is no added to the dialog box.)

Syntax

CollectValues(in_value)
ParameterExplanationData Type
in_value
[in_value,...]

The input values to be collected.

Any Value

Derived Output

NameExplanationData Type
out_value

The collected values.

Any Value

Environments

This tool does not use any geoprocessing environments.

Licensing information

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