ModelBuilder - Iterate Feature Selection Logic Help

1332
3
10-21-2021 12:14 PM
Henry
by
Occasional Contributor II

Hi all,

I'm trying to get some good use out of the Iterator tool in ModelBuilder and set up some processes to simplify my workflow - and am just having a bit of trouble getting the logic right on my process.

My ultimate goal is to:

  • iterate through one of our Hosted Feature Services in AGOL of watersheds
    • select each one by its respective Name (using the Name field in the Group By Fields parameter)
  • For each selected watershed, use select by location to capture points from a separate subset of data that fall within the watershed's boundaries
  • Export the attribute table of the select by location output to an Excel Sheet.

So I can ultimately create a table that has the attribute table of all those features within each watershed.

To test that my iterator is selecting things properly I'd thought I'd set the output selection connected to the Feature Class to Shapefile tool to see if I can at least get an independent shapefile of each selected watershed from the iterator.

However, I only end up with a single output shapefile which doesn't contain the name of the watershed from the Name field - just "I_0_Name". I've tried setting the output location to use the inline variable "%Value%" but I still only get one shapefile in the output with the name having "%Value%" as a string in the name - not the actual name of the selected feature.

I'm definitely missing something or misunderstanding the purpose of the Iterate Feature Selection tool - if that tool can't accomplish what I'm considering, is there another tool that would work better?

Thanks!

Henry
0 Kudos
3 Replies
DavidPike
MVP Frequent Contributor

Are you able to share screenshots of your model, and output parameters for FC to Shapefile?

0 Kudos
Henry
by
Occasional Contributor II

Hi David, here's some screenshots and more details about the model I'm attempting.

  •  First, the Iteration parameters, with the Hosted Feature Layer as Input and the Name field:

Screenshot 2021-10-25 130854.png

  • Second, the output parameters from the shapefile to feature class tool

Screenshot 2021-10-25 130836.png

  • And here's just the general model overview

Screenshot 2021-10-25 130758.png

Thanks!

Henry
0 Kudos
DavidPike
MVP Frequent Contributor

I think you're a bit stuffed by only being able to specify the output location rather than filename using Feature Class to Shapefile.

I would try other tools such as Copy Features or Feature Class to Feature Class and specify the outpath using the same  inline variable substitution you've tried previously (not forgetting the .shp extension at the end).

D:\Working\MyFolder\%Value%.shp

 

0 Kudos