Select to view content in your preferred language

Using Append after a Spatial Join in Modelbuilder

326
1
2 weeks ago
Leah
by
New Contributor

I am attempting to automate a process using modelbuilder. The workflow is as follows: A calculate field is run on an input dataset parameter, then a SPATIAL JOIN is applied to the output. This part works properly. However, Then I want to run an APPEND on the output of the spatial join (AKA, Parameter (3)). However, one of the fields I am attempting to append is linked to the spatial join preceding step; each time the appended field presents itself as INPUT_AddSpatialJoin_#, where the # corresponds to the number of times I have run the spatial join process within the process. This creates an issue as this model will need to be run on a weekly basis, and each time the # value will change and not append properly. A similar issue occurs if attempting to use a fieldmap file for this process, as it uses the outdated # value. Is there a way to work around this, such that the _# can be eliminated from being added to the AddSpatialJoin append field?

0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor

I've come across this issue so it makes using the Add Spatial Join tool impossible to use in modelbuilder as you cannot predict that number. I think its a bug and have reported it to ESRI. But I suspect it won't get fixed. The Add Spatial Join tool was added to Arcpro 3.2. Consider not using that tool and using the classic spatial join tool. The key difference is that this tool creates an output and does not have that field qualification.

0 Kudos