1

I have a File Geodatabase in which there are 3 stand-alone tables and I have a shapefile to which I want to join fields of the standalone tables. I am using the Iterate Table tool of the ModelBuilder which runs fine, however, the issue that I am facing is that in the attribute table of the output only fields of the last table are being joined.

Am using ArcGIS Pro 2.6

Am not sure what am I missing.

enter image description here

1
  • Not sure, but perhaps the Join Table field needs to be a variable, not hard coded, otherwise it would always be the last one iterated. That is why Iterate Tables produces Name, so each output can be uniquely named. I get that you just want one join as the end result.
    – danak
    Commented Mar 9, 2022 at 23:25

1 Answer 1

0

You have not understood the implication of using an Iterator. A quirk of an iterator is that EVERYTHING in the model runs as many times as the iterator loops. This is documented in the help file.

Now you understand that, look at your model logic, you create a table, do a spatial join then join your field(s) to it from a table in your New File geodatabase. That's loop 1 of 3.

Loop 2, you create a table, do a spatial join then join your field(s) to it from a table in your New File geodatabase.

See what happened? You just overwritten the Featureclass by creating a table again. Obviously loop 3 overwrites again... Hence you only end up with the last table fields

You need to read the help file on the subject of embedding models within models, this is critical when using iterators.

The iterator and join fields tool need to be in a sub-model.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.