Hello,
I'm trying to merge feature classes, that come from a submodel ("PFA_findBiggest") via inline variable substitution. They are saved in a GDB.
They all have different fields. I want to merge them into one big table according to a fishnet_FID, that they all carry.
Here you can see, I tried the merge function in order to merge them into a feature class, but this didn't work. It only ever 'merged' the first %n%, which of course is 0, and nothing else. So the output of Merge is identical to the first layer processed.
I guess it's because Merge doesn't know that more is coming. That's why I have put the Collect Values in between. It is set to:
Why is this not working?
Solved! Go to Solution.
Your sub model PFA_findBiggest needs to be in a sub-model itself, looping and ultimately providing a single output (collect values) as a parameter. Then you have a list of datasets ready to feed into the merge tool as that need only run once.
Your sub model PFA_findBiggest needs to be in a sub-model itself, looping and ultimately providing a single output (collect values) as a parameter. Then you have a list of datasets ready to feed into the merge tool as that need only run once.
Duncan is right on here, the Collect Values tool needs to be inside a sub model that returns the collected values as a returned output parameter. There is an example of this in the help on model interators.
Thanks guys. I remember that I ended up doing it all in python using arcpy directly.
That's great. Model Builder is really useful, but sometimes your workflow just requires a Python script!