I'm not sure I understand what you are trying to do with this line (besides you needing == isntead of =).if long( [POLE_PRIKEY] ) = long( [POLE_PRIKEY] ):
Something like this should work though.def FindLabel([FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT], [POLE_PRIKEY]):
if long( [POLE_PRIKEY] ) == long( [POLE_PRIKEY] ):
labelText = '{0}\n{1}\n{2}'.format([FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT], [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT], [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT])
return labelText
else:
labelText = [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT]
return labelText
In terms of accessing the data from a relate, I think you will need to look into using a join.