Custom message configuration for Alarms

I have an expression bound to an alarm's custom message which is as follows :

if({State} = "Active",{activemessage},if({State} = "Clear",{clearmessage},if({State}  = "Ack",{acknowledgemessage},"ERROR")))

where activemessage, clearmessage and acknowledgemessage are associated datas which contains the string to be displayed and {State} is the event state of the alarm.
When the alarm is active it displays the active message , when it is acknowledged it sends out an acknowledge message but when the alarm is cleared, it sends out the acknowledge message instead of the clear message.
is there a property other than State/ IsClear that can be used in the expression to check whether the alarm has been cleared. If you require any more information just comment on it. Thank You.

I'm just guessing here, but maybe when an alarm is cleared, it is also acknowledged. If that's the case, you may need to change the order of your checks. Cleared then acknowledged, then active. I imagine the if chain stops at the first true expression.

I tried a similar expression checking if it is cleared first then acknowledged as you mentioned. The state property never changes to Clear, when the alarm is cleared but stays in the Ack state and when the alarm is active again it returns cleared,i, is basically returning the previous state instead of current state of the alarm. Any suggestions regarding that?

You might want to double check the documentation.

Disclaimer: I don't have experience in Ignition, but I still like to chime in if I think might be able to help.

When I create a solution looks like it should work but doesn't, it helps to break it apart and test each element/statement separately. For your situation, I'd make alarms for each of condition and log out values at every opportunity. Maybe make a test screen with fields for all the values you're working with.

That's just generic troubleshooting advice, hope you find the answer to your problem!

Should it be clear or cleared? I have a feeling it's cleared