Iterator in the model doesn't add outputs in the Contents

359
5
Jump to solution
10-12-2020 06:01 PM
hm_stella
Esri Contributor

Hi all geog folks,

I got a problem in using the model builder of ArcGIS Pro. I made a very simple model using the iterator (Iterate Feature Selection). It seems working good - I got all outputs saved in the gdb and everything opened well. However, the thing is that having listed those outputs on the Contents is not available. 

I could only see that the very first outputs are on the Contents while the rest is just saved in the gdb. I want all of my results showing on the Contents. Please give me a hand if anyone knows how to fix this.

Thank you

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Honored Contributor

I don't use modelbuilder but it seems

Collect Values (ModelBuilder)—ArcGIS Pro | Documentation 

might be worth a look

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.


... sort of retired...

View solution in original post

5 Replies
DanPatterson
MVP Honored Contributor

I don't use modelbuilder but it seems

Collect Values (ModelBuilder)—ArcGIS Pro | Documentation 

might be worth a look

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.


... sort of retired...

View solution in original post

hm_stella
Esri Contributor

Hello Dan,

I tried Collect Values and it did work as how I wanted!

Thank you so much

0 Kudos
ShitijMehta
Esri Regular Contributor

Hello Hyun-min Joo, 

  • Which version of the product are you using?
  • Add to Display works to add all the outputs from the Iterator if the Add to Display flag is set before and the tool is run after that. If it is not adding all the outputs then it could be a bug. 
  • We have a known limitation that if you run first and then go back to the model and set the add to display on, on the output of the iterator it will add the output only from the last iteration. Is this the case you see?
  • Also, Collect Values is a good way as Dan pointed out.

Thanks!

 

0 Kudos
hm_stella
Esri Contributor

Hi Shitij Mehta!

I am using the latest version of ArcGIS Pro. I selected to Add to Display options for all the outputs I would have, saved the model, and ran it. It obviously makes the results, but only when I am running it in model builder tab. Every time I use the model as Geoprocessing tool, it doesn't bring every single result from the gdb as the path I set. 

I tried Collect Values Dan suggested, and it perfectly worked out. Thanks!

0 Kudos
ShitijMehta
Esri Regular Contributor

Now I see. Yes, Add to Display only works when run from within a model. If you want to add something to display when a model tool is run from a tool dialog it has to be a parameter. Iterator case is unique, it runs all iterations internally and then when the whole model is done running it adds the final output to display when run from model tool dialog (gp pane)

Output from an iterator is a single value and hence can only add a single output in the end.

What Collect value does is - it collects all the outputs from all iteration and then adds all of them together at the end since it is a multivalue output and has knowledge of all the outputs.

I am glad you are using the Collect Value tool.