I am making a geoprocessing model in ArcGIS Pro 2.5.0.
I have a file geodatabase feature class of 540 points that is created by an earlier step in the model. I then use a Select By Location to select some of the points that fall within a polygon. So far so good. 428 points are selected, I can confirm this by inspecting the table and the the little Count oval that is attached by select by location.
From here I do a Calculate Field, but it updates all of the features. Strange thing is that in the output of the Calculate Field tool still shows the 428 selected rows, but even the unselected ones have new values calculated.
Odd! so I tried attaching the output of Select By Location to a Create Feature Layer tool, expecting to have a feature layer that just has the 285 points within the polygon. But it seems that the Create Feature Layer tool, like the Calculate Field Values tool does not recognize the selection, as it contains all 540 of the original points.
Having read a similar post which suggests that this is due to having multiple layers with the same name, but I don't. Other then the new layer that I create with the Create Feature tool, all of the layers in my model are the default names applied by the model builder. One odd thing is that each time the model runs, the Select By Location tool increments the layer number of its output. So maybe the model is confused by a phantom layer that it things exists that is not visible anywhere.
Being superstitious, I have tried rebuilding this model from scratch in a completely clean workspace. Still no joy!
Anyone else having a similar problem? I attach a streamlined demonstration with an ArcPro project and toolbox in case anyone is interested.
Sounds like this may be the bug logged through support as [BUG-000129659] Selection made through Select Layer by Location is not passed to the next step in ModelBuilder when running as a tool if Input Features is not made as a variable beforehand.
If so, it is fixed in the upcoming release of ArcGIS Pro 2.6 (planned for July).