Run condition variable doesn't work with a variable e.g #{MyVar} as a variable expression

I want to run a step only in case a step variable is defined in a previous step.
So, I thought that adding the variable expression #{Octopus.Action[StepA].Output.MyVar} in the run condition variable of that step would work, but it is always evaluated as false.
I found a workaround by writing #{ if Octopus.Action[StepA].Output.MyVar}True#{/if}
However, I think that either how the expressions should be is not well explained in the documentation, or that something is not working properly.

Hi,

T̶h̶a̶n̶k̶s̶ ̶f̶o̶r̶ ̶r̶e̶a̶c̶h̶i̶n̶g̶ ̶o̶u̶t̶.̶ ̶I̶f̶ ̶y̶o̶u̶ ̶w̶a̶n̶t̶ ̶t̶o̶ ̶s̶e̶t̶ ̶y̶o̶u̶r̶ ̶f̶i̶e̶l̶d̶ ̶c̶o̶n̶d̶i̶t̶i̶o̶n̶ ̶t̶o̶ ̶"̶I̶f̶ ̶v̶a̶r̶i̶a̶b̶l̶e̶ ̶[̶M̶y̶V̶a̶r̶]̶ ̶h̶a̶s̶ ̶a̶ ̶v̶a̶l̶u̶e̶"̶,̶ ̶t̶h̶e̶n̶ ̶y̶o̶u̶’̶l̶l̶ ̶h̶a̶v̶e̶ ̶t̶o̶ ̶s̶t̶i̶c̶k̶ ̶w̶i̶t̶h̶ ̶̶#̶{̶ ̶i̶f̶ ̶O̶c̶t̶o̶p̶u̶s̶.̶A̶c̶t̶i̶o̶n̶[̶S̶t̶e̶p̶A̶]̶.̶O̶u̶t̶p̶u̶t̶.̶M̶y̶V̶a̶r̶}̶T̶r̶u̶e̶#̶{̶/̶i̶f̶}̶ ̶̶ ̶ ̶T̶h̶i̶s̶ ̶i̶s̶ ̶d̶e̶f̶i̶n̶i̶t̶e̶l̶y̶ ̶n̶o̶t̶ ̶w̶e̶l̶l̶ ̶e̶x̶p̶l̶a̶i̶n̶e̶d̶ ̶i̶n̶ ̶t̶h̶e̶ ̶d̶o̶c̶s̶,̶ ̶a̶n̶d̶ ̶I̶’̶v̶e̶ ̶a̶l̶r̶e̶a̶d̶y̶ ̶s̶e̶t̶ ̶m̶y̶s̶e̶l̶f̶ ̶a̶ ̶r̶e̶m̶i̶n̶d̶e̶r̶ ̶t̶o̶ ̶a̶d̶d̶ ̶i̶t̶ ̶t̶o̶m̶o̶r̶r̶o̶w̶ ̶m̶o̶r̶n̶i̶n̶g̶.̶ ̶T̶h̶a̶n̶k̶s̶ ̶f̶o̶r̶ ̶t̶h̶e̶ ̶h̶e̶a̶d̶s̶ ̶u̶p̶ ̶a̶b̶o̶u̶t̶ ̶t̶h̶i̶s̶.̶

Please jump straigth to the next comment

Best regards,
Dalmiro

Hi Konstantina,

I have good news: A couple of hours after I sent me previous message, the team discussed the expected behavior of this and agreed that we should treat a variable with a value NOT equal to empty, 0 or “false” as Truthy. So this should work the way you initially expected it to.

Another good news is that we shipped a fix for this already, and it should be in the next version of Octopus (3.8.8): https://github.com/OctopusDeploy/Issues/issues/3150

I’m gonna edit my previous reply so ppl running into this thread don’t get confused.

Thanks!
Dalmiro

Hello Dalmiro,

Thank you for the update! I’ll keep an eye for the next version.

Keep up the good work!

Best,

Konstantina