if-else-if-else in textfield expression [duplicate]

You can use a nested ternary statement to achieve this but it’s messy.

For example:

(i == 1) ? "Send" : ((i == 2)? "Received" : "Cancelled");

Leave a Comment