I've been experiencing inconsistencies with trying to add a spatial join between two hosted feature layers in ArcGIS Pro 3.3.2.
Essentially, I have two point layers that I need to field calculate attributes from one (GPS Layer) to another (Master Layer) based on a spatial join. I'm only interested in working with a subset of features at a time. Here is my workflow:
At first I had tried doing the join by right clicking on my Master Layer from selection in the contents pane > Joins and Relates > Add Spatial Join. The join would run, but when I checked the attribute table, not all of the attributes from the GPS Layer transferred over. Some attributes like GPS metadata transferred successfully, but other attributes did not. It seemed like it transferred the attribute information from the target layer instead. Weird.
So I got on a call with tech support, and we tried doing the join by going into the Geoprocessing tools pane and finding the Add Spatial Join geoprocessing tool. The join ran and the attributes transferred over successfully as I needed them to. We landed on "well maybe there's a bug when trying to run the join from the contents pane, so just use the geoprocessing tool from now on".
But now I'm returning to my work flow a week later, and the geoprocessing tool is now behaving incorrectly just how the content pane join workflow did.
I don't know how I got it to work the one time, but performing a basic spatial join should not cause this much headache. I'm not able to QAQC my data until I figure this out. I'm also trying to make a model builder tool for this workflow, but I can't rely on that if the join does not consistently work.
Both layers are hosted feature layers on AGO. The GPS layer has a definition query on it in my Pro project. I've tried clearing cache, opening and closing my project, and removing the definition query.
Writing this to see if anyone else has experienced this and to try to get attention from Esri (not tech support). Thanks!
This may be related to what you're experiencing - BUG-000173018 - "When running the Add Spatial Join tool between two hosted feature layers, it fails after the second run and returns error 999999." It's reproducible in ArcGIS Pro 3.1 and 3.4 and fixed at ArcGIS Pro 3.5.
The
Detailed explanation:
I have three feature layers; If I run the tool between Hosted Feature Layer 1 and Hosted Feature Layer 2 it works fine.
However, if I try to reuse it with Hosted Feature Layer 1 and Hosted Feature Layer 3, it fails with the error "99999: Something unexpected caused the tool to fail." We have to remove the old joins to be able to rerun the tool.
If we do the same using feature classes, it works fine. It is reproducible with small features.
Further - if the Add Spatial Join was run on two "local" layers, then no error was seen.