Select to view content in your preferred language

Label Expression Validation in ArcGIS Pro

213
3
10-21-2025 11:34 AM
Status: Closed
Labels (1)
MarcelSt-Germain
Frequent Contributor

When using Advanced Python label expressions (e.g., defining a custom FindLabel function), the Summary tool in ArcGIS Pro reports misleading errors such as:
Label expression is invalid.
Carriage returns are not allowed in simple expressions.
No function was found with the name 'FindLabel'.

Despite these warnings, the labels display correctly in the map and the Python expression validates successfully in the Label Class dialog. The problem is not with the expression itself, but with the way the Summary tool attempts to validate label expressions as if they were simple expressions only.
Impact
- Users may believe their label expressions are broken, even though they work correctly.
- This creates unnecessary confusion and undermines confidence in the labeling workflow.
Suggested correction
Instead of reporting the expression as “invalid,” the Summary tool should recognize when a label class is using an Advanced expression and display a more accurate message, for example:
“Advanced label expression detected. Expression not validated by Summary tool.”

This would make it clear that the expression is outside the scope of the simple validator, while reassuring users that their labels may still function as expected.

 

3 Comments
CraigWilliams
Status changed to: Needs Clarification

Marcel, Can you provide an example of the expression you're experiencing this with? I'm unable to reproduce this with a FindLabel function (which we look for to detect the advanced expression)

MarcelSt-Germain
First, why can't we be able to work when Labeling Summary is open.  We have to copy and paste in text but, then, we lost formatting (no color, no indentation) ???  So make the Labeling Summary available or format when copying.
Issues (0) but, this is one exemple of the return.
Python advanced script is validated, show in map but still generated the warning.
 
Group Layer: Version ENC5 EN-FR m
Group Layer: ***ENC principaux
Font: Arial Narrow-Bold; TTOpenType
Layer: point_light : ML m/ ft
Label Class: INFO light
Labeled class.
SQL Query not defined. All features will be added to the placement engine.
Label expression is invalid.  Invalid Expression.
Carriage returns are not allowed in simple expressions.
No function was found with the name 'findLabel'.
CraigWilliams
Status changed to: Closed

We've identified the issue and logged BUG-000180302. Since Ideas isn't intended for bug submission, I will close this Idea.