Variable Comparison with ${None}

Hi

I’m writing following comparison in condition:

IF ${x} != ${None}
Do Something
ELSE
Do Something Else
END

And this is not working due to the following error:
[FAIL] Evaluating IF condition failed: Evaluating expression ‘“Caption1”;“Caption2”;“Caption3” == None’ failed: SyntaxError: invalid syntax (, line 1)

If I enclose variable name in single (or double - i believe it should work) quotes like below it will work as intended

IF ‘${x}’ != ‘${None}’
Do Something
ELSE
Do Something Else
END

I understand that this is due to the evaluation nature of this syntax, but I’m not sure if some casual citizen will understand this

Honestly, I don’t quite understand it myself and will be grateful if somebody can enlighten me on this syntax, otherwise it seems that using Python code is more concise

When I have to deal with None I switch to inline python evaluation. So in your case it would be:

IF ${{$x is not None}}
    Do Something
ELSE
    Do Something Else
END
2 Likes

Thank you, this is also working.