In ModelBuilder for ArcGIS Pro, I'm trying to create an iterative model for merging pointfiles according to their names. This is a pre-processing step to handle echo-soundings, spread over one or multiple files per lake, for the creation of lake-bathymetric maps.
The idea is to keep the point.shp files named according to "LakeName_n"(where LakeName = actual lake name and n=numerical order of files) in a folder named "LakeName" which is then kept in a main working directory. To use the model you'd only have to give the path to the main working directory for it to then go through each of the "LakeName" folders and merge (all) the LakeName_n.shp for each lake individually.
I have made a nested model that collects the values/files that are then to be used in the merge (img. 1 & 2).
I have gotten so far as to be able to either merge all the .shp files from all of the folders together or, by using wildcard, managing to do it for just one of the "LakeName" folders. But I can't seem to make this last atempt iterative. I.e. making a separate merged output for each lake.
I have tried using only the Name variable as input to both the Collect and Merge functions.
I have tried simply using %Name%* and also (by using parse path) %Workspace_name%* as wildcards, but the wildcard only seems to work if the "LakeName" is excplicitly spelled out for each individual lake.
I have allso tried adding "Iterate multivalues" within the parent modell without success (img. 3).
How can I do this?