I'm trying to replace the text in a field to build a label expression. The field I'm using is called [Organizatio] and it holds the school's name. What I want is to tell ArcMap that when that name includes 'Central School District' - change it to "CSD."
This is what I have. ArcMap says it's valid but it does not make any changes.
1 Answer 1
As I mentioned in commentaries:
Use in pre-logic script code block:
def FindLabel(field):
string = field
newstring = string.replace('Central School District ', 'CSD ')
return newstring
In field definition (test2
is the object field):
FindLabel( !test2! )
Result:
test1
and test2
had the same values initially
Explore related questions
See similar questions with these tags.
FindLabel(!Organizati!)
. Check documentation for more information