Select to view content in your preferred language

Failed to evaluate label expression - it's just a field?

478
7
Jump to solution
08-08-2025 01:05 PM
KristyCline
Emerging Contributor

I can't quite wrap my head around this one. I have a project that was created with ArcGIS Pro 2.9. I have upgraded it to 3.5. I have a polygon layer ('Sub Grid') that is set to show labels using the value in a field, 'GRIDPIN'. That's it. Although the labels are showing up exactly as expected in the map, I am getting a drawing alert.

You can see the field 'GRIDPIN' listed in the Fields section of the Class tab. It definitely exists.

KristyCline_2-1754682790647.png

There is no SQL expression set on the label class. There is no definition query on the layer.

KristyCline_3-1754682812845.png

Several other layers in this project have labeling enabled, and some of those required more complicated Python logic. I'm pretty sure I must be overlooking something that should be obvious, but I'm stumped.

 

0 Kudos
1 Solution

Accepted Solutions
Robert_LeClair
Esri Esteemed Contributor

Yep!  I saw 2.9 on your initial question and I'm thinking - "Wow!  That's pre 3.0 geodatabase!  Old!"  So things can get quirky for sure.  You could upgrade your existing geodatabase and see if that helps too.  In the Catalog Pane, do a right-click on your geodatabase->properties.  On the General tab, expand geodatabase version and upgrade status.  If the Run Upgrade button is active, you can click that so it's an updated fGDB.

View solution in original post

0 Kudos
7 Replies
Robert_LeClair
Esri Esteemed Contributor

So a couple things I'm seeing that are related to your experience:

1.  If you switch the language from Python to Arcade, does the error message persist?  The expression would be $feature.GRIDPIN
2.  There is BUG-000164308 - "The drawing error, "Failed to evaluate label expression. Error parsing the WHERE clause. One or more fields could not be found." is returned after adding a label expression that uses Shape.STLength() in the WHERE clause."  Not exactly related but close.  It was non-reproducible and first noticed in ArcGIS Pro 3.2 due to the introduction of Drawing Alerts.  Are you using a file or enterprise geodatabase in this case?

0 Kudos
KristyCline
Emerging Contributor

Hello Robert!

Thank you for your quick reply.
The issue seems to persist no matter what language the label expression is written in. The data is being sourced from a local file geodatabase.

0 Kudos
Robert_LeClair
Esri Esteemed Contributor

Interesting.  Okay, try this.  In a new ArcGIS Pro project  use the new default file geodatabase, copy/paste the FC to the default fGDB, label the FC using any expression language you want and see if the error message persists.  If it does not, then there's an issue with the original FC.  You can use the Repair Geometry GP tool to see if there's an issue with the original FC too.

0 Kudos
KristyCline
Emerging Contributor

Great suggestions! I copied the feature class over to the new default geodatabase created as part of a new project, and labeling worked fine there. Unfortunately, repairing the geometry of the original feature class did not resolve the labeling issue. I ended up removing the layer, re-adding it, and re-setting symbology and labeling properties for all maps using that layer, and that seemed to resolve the issue. Funny how feature classes can sort of decay in a project if you leave them be long enough. 🤔

0 Kudos
Robert_LeClair
Esri Esteemed Contributor

Yep!  I saw 2.9 on your initial question and I'm thinking - "Wow!  That's pre 3.0 geodatabase!  Old!"  So things can get quirky for sure.  You could upgrade your existing geodatabase and see if that helps too.  In the Catalog Pane, do a right-click on your geodatabase->properties.  On the General tab, expand geodatabase version and upgrade status.  If the Run Upgrade button is active, you can click that so it's an updated fGDB.

0 Kudos
RTPL_AU
Honored Contributor

@KristyCline  I'd strongly suggest making copies of your FGDBs prior to doing any upgrades. 

There have been a couple of one-way doors in Pro and you never know when you need to be able to get an old project up & running again. Easy to download & install 2.9. Hard to timetravel a FGDB.

 

@Robert_LeClair  Please add "Make a backup or ensure you have a backup" before "You could upgrade your existing geodatabase and see if that helps too"  in the future. I know the assumption is that everyone is an IT professional and works in a utopian environment where everything is backed up and snapshotted every few minutes. When faced with a deadline and an irritating problem, people may just follow your guidance blindly without thinking about the unsaid consequences.


0 Kudos
Robert_LeClair
Esri Esteemed Contributor

Yes.  Creating a backup is best practice certainly.  To determine client/geodatabase compatibility, this help documention is a great resource.

0 Kudos