AnsweredAssumed Answered

Use Field Calculator to create mailing address block

Question asked by ChrisMartinez on Apr 17, 2013
Latest reply on Apr 18, 2013 by ChristopherMartinez
I have a table that has all the attributes of a feature broken out into individual fields.  I would like to assemble the fields into a printable mailing label.  Some of the fields may or may not have values, and should only be included if they do.  I tried to set this up to be fairly generic so I can reuse it, but I'm having trouble passing multiple values.  Any help would be appreciated.
From Pre-logic code:
def strFunction(myFields[]):   returnString = ''      for thisField in myFields:     if(not IsNull(thisField);       returnString = returnString + thisField   return returnString

mailLabel = strFunction(!ownerName!, !addressLine1!, !addressLine2!)

I can work out the string formatting as soon as the code works.