AnsweredAssumed Answered

Label formatting issues

Question asked by Dan_Patterson Champion on Sep 30, 2018
Latest reply on Oct 3, 2018 by Dan_Patterson

Labels using Python (not interested in Arcade)


Issue 1:  Ok... times change so the field... !OBJECTID! is now [OBJECTID] when using python and migrating from ArcMap to ArcGIS Pro.  Being a 'whatever' kind of guy when it comes to software changes, I can live with this (sort of). That was an esri decision on how they want to delimit 'fields'.


Issue 2:  I do draw the at changing how the chosen label language is treated.

          Python 3.6/7 has some very useful format options, that enable you to produce output as string(text) without have to do type conversion.  For example... notice, an integer was automagically formatted to a string and you can do 'math' with the integer


# ---- python ----

objectid = 1

"id {} -> {}".format(objectid, objectid-1)

'id 1 -> 0'

# ---- as expected ----


However... Things are not as expected when using label formatting, as above, with python.

Must have made a mistake....

ok... ! ! is now [ ]

spelling correct

format string is fine

error message makes no sense








Now... what you have to do is

int the string, that is actually an int so you can string it


With me?


The whole utility of allowing for format language options is good.  However, I expect the language rules to be respected.



So the question


Is this a bug?

If it isn't a bug, can someone explain the logic?


I am not interested in the other language options, or a different labelling engine.

Just plain simple labels, that would be great, respecting the way that this should work.