I was trying to write and if calculation and I cannot figure out the syntax to complete it. The one on the left doesn’t work as it will return the text of the calculation I am trying to perform instead of the value. One on the right is the calculation that I want to use:
No =
func(!Form_Name!)
Code Block
def func(input):
if '_' in input:
return '!Form_Name!.split("_")[1]'
elif '-'in input:
return 'Yes'
else:
return 'No Match'
Calculation Formula I want to use:
!Form_Name!.split("_")[1]
That is what i am getting and not the caclulated value in the field.
I am new to this and trying to learn.