ArcMap Iterator and Model Builder

547
8
02-17-2023 07:01 PM
Labels (1)
DanCrawford_work
New Contributor

ArcMap 10.8

Hello, I'm having difficulty using the iterator in my model.  This is what I want it to do:

Iterate through a list of SDE feature classes
For each SDE layer, make a temporary feature layer
Take that feature layer and perform a selection by location
Append the selected features into an existing geodatabase feature class.

So my model works perfectly except that the attributes are not being carried forward to my geodatabase feature class.  The spatial data, in this case lines, comes over.
I know it's not an attribute compatibility issue as it works when done manually.

Not sure what I'm doing wrong... any suggestions would be appreciated.

DanCrawford_work_0-1676689135768.png

 

 

0 Kudos
8 Replies
DavidPike
MVP Frequent Contributor

Do your Schemas match?  Seems like they probably don't and you have "NO_TEST" set on the append tool.

0 Kudos
DanCrawford
New Contributor

Thank-you for the suggestion.
I tried appending to a new layer which was built using the same schema as the input data set.  Same result unfortunately.  Strange thing is, I can copy and paste the features in ArcMap and the attributes come over.

0 Kudos
DavidPike
MVP Frequent Contributor

Did you refresh the field mapping in the Append when you changed the input?  I'd delete that append and recreate it just to be sure.  What happens when you use merge in the model instead of append?  If that copies all the fields across then it means the issue is definitely with how your append is set up.

0 Kudos
DanCrawford
New Contributor

Thank-you again.

Tried deleting and rebuilding the append process but had the same issue.
Merge was a non starter as the process wouldn't allow me to use a variable as an input.
What does seem to work (I need to test more extensively) is to copy the selected features to a temporary feature class in front of the append.  When I append that layer, the attributes come over.

DanCrawford_0-1676749378142.png

 

0 Kudos
DavidPike
MVP Frequent Contributor

strange, but if it works.  Just fyiu there is an in_memory workspace which may save you some clutter https://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/the-in-memory-workspace.htm

e.g. Copy Features output location -> in_memory/%Values%_CopiedSelection

0 Kudos
DanCrawford
New Contributor

Thanks for the tip.  I'll try that.

0 Kudos
MichaelVolz
Esteemed Contributor

Have you considered exporting the model to a python script?

0 Kudos
DanCrawford
New Contributor

I'm afraid I'm not a python programmer.

0 Kudos