Page 1 of 1

Example - Use a variable value in a conditional IF

PostPosted: Fri Mar 03, 2023 11:15 am
by jay (support)
I've just posted an example shortcut in the Library that illustrates how to get a variable, then use the variable value in an IF statement in a Shortcut. This turns out not to be as obvious as one might think. The key is that you have to explicitly tell the IF condition what the type of the value being compared against is. And (in a bout of exceedingly poor design), you can't do that in the IF condition itself, but rather in the statement before the IF you have to convert it. This shortcut shows you how to do that.

Note, there are probably other ways of doing it as well - I'm no shortcut expert, but here is one way of doing it.