Tag Alarming - Expression

Hi there, I have an alarm to show display message when triggered:

left({itemPath},indexOf({itemPath},"/")) + " - " + substring({itemPath},indexOf({itemPath},"/F")+1,len({itemPath})) + " - " + {notes} + " - P" + {PlattenNo}

it works fine, however when I add if statement (below) the message displays the path to the tag instead.

if {PlattenNo} == 0:
left({itemPath},indexOf({itemPath},"/")) + " - " + substring({itemPath},indexOf({itemPath},"/F")+1,len({itemPath})) + " - " + {notes} + " - P12"
else:
left({itemPath},indexOf({itemPath},"/")) + " - " + substring({itemPath},indexOf({itemPath},"/F")+1,len({itemPath})) + " - " + {notes} + " - P" + {PlattenNo}

PS: {PlattenNo} is Associated Data.

Appreciate,

You can’t use an if statement in an expression. You must use the expression language’s if function. Different syntax entirely.

https://docs.inductiveautomation.com/display/DOC81/if