I am trying to use Select by Attributes within model builder. The input layer is a feature layer that is created.
My model fails on the Select By Attribute step with an error message saying that the specified field can not be found. This is the field that I have specified in the input layer.
Anyone know why this is?
Solved! Go to Solution.
Knowing how things are connected and understanding how things are connected helps understanding what is happening and could be causing the error. Guessing what might be the problem will not be very effective in order to solve the problem.
I don't see any parameters defined, so I guess that the names are kinda "hard coded" in the model which should not cause the field "ExcelToTable12_Features.Townlands" not te be found in the select by attributes. In case you want to have a physical result, without the temporal join you could use Join Field—Help | ArcGIS Desktop instead (in case the join is by attributes) or use Feature Class to Feature Class—Help | ArcGIS Desktop after the join to create a new featureclass with the additional fields.
Add Join can be a challenge in Model Builder because you need to explicitly remove the join before you run it again or it gets confused.
I'm with Xander, I'd simplify things by copying the output of select layer by location with Copy Features to a temp dataset (in in_memory if not too big) and use Join Field to add the data directly from the output from Excel To Table. Oh, and I'd run Excel To Table to a geodatabase temp table instead of a dbf. (No need to make an XY event layer if you are just going to add the fields to another table which already has locations.)
Joins work better when both tables have an ObjectID field, external data sources like .xlsx and .dbf do not have objectID fields, so joins won't have as much functionality (and run slower). Best to import the data to Esri world (in_memory, temp geodatabase table) before doing joins, so you get the benefit of the OID field.