Labeling expression with python scripts

726
5
Jump to solution
06-27-2017 01:11 PM
nimitz
by
New Contributor III

Hi all,

I have a geodb file that has a field for pole numbers. I'm trying to label only poles, but the field also has some manhole numbers and pull box numbers - I don't want to label those. The pole numbers always begin with a "PP", so an example is like "PP6042". Whereas a manhole would beging "MH" and pulbox "PM". How can I only label poles with the PP? It seems like this would be straightforward, but I'm drawing a blank on this.

Thx for any help,

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi Randy,

Below is an example.  'Label' is the field name.

View solution in original post

5 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Randy,

Below is an example.  'Label' is the field name.

nimitz
by
New Contributor III

The error, "Error 1 on line11, Expected 'Then'.

I tried to place "then" on a new line and the same line, but the exact error comes up.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Make sure you have 'Python' set as the parser.  Also, can you upload a screen shot?

nimitz
by
New Contributor III

I'm sorry, I had checked the "VBSCRIPT" dropdown by accident. I have since changed it to Python and it works beautifully!

0 Kudos
nimitz
by
New Contributor III

You 'da man!

0 Kudos