ArcGIS Advanced Python Label Expression Problem

Viewed 15

I'm setting up a Python label expression in ArcGIS Pro 2.9.3. ArcGIS Pro lists the expression as valid. I have several lines of text and only the top line will appear when I turn on the label. I've switched order of labels and only the top one labels. I have tried replacing the 'if' with 'elif'. I have added 'else' with no success. I have not done advanced labeling before. At first I was using '!= None:' and read today that != should not be used with None so I replaced it with 'is not None:'. Below is the label expression and attached is an image of the label I am obtaining. Additional question, in the attached image, is there a way to force the text showing to be on one line? Thanks!

def FindLabel ( [WR_Number], [TotalDepth_Ft], [SurfElev], [TotalFlow_CFS_Appropriation], [MWBZ_TopElev], [MWBZ_BotElev], [MWBZ_Center], [StaticWaterLevel_Ft], [StaticComments] ):
if [WR_Number] is not None:
    return [WR_Number] + " EL: " + [SurfElev]
if [TotalDepth_Ft] is not None:
    return "\n" + "D: " + [TotalDepth_Ft] + "'"
if [TotalFlow_CFS_Appropriation] is not None:
    return " Y: " + [TotalFlow_CFS_Appropriation]
if [MWBZ_TopElev] and [MWBZ_BotElev] is not None:
    return "WBZ: " + [MWBZ_TopElev] + "-" +[MWBZ_BotElev]
if [MWBZ_Center] is not None:
    return "\n" + "MWBZ Center: " + [MWBZ_Center]
if [StaticWaterLevel_Ft] is not None:
    return "  Static BLS: " + [StaticWaterLevel_Ft]
if [StaticWaterLevel_Ft] <= 0:
    "\n" + [StaticComments]

Only top line labels

0 Answers
Related