I am trying to pass a request header based on a variable and whenever the variable does not equal true, the value is stringified. For example, I am trying to set a header = {{retoolContext.inEditorMode}}
It behaves as expected when {{retoolContext.inEditorMode}} evaluates to true:
But when it evaluates to false this is what I see:
Assuming this behavior is not expected?
Hey @stephbis! Was able to repro this and will bring it up with our core engineering team. In the interim, it does seem that using a ternary there will give you the header values that you are looking for:
Retool request:
Headers received:
Let me know if that works for you!
Hi @stephbis,
I think in the second case, it's evaluated to undefined
instead of false
, and thus excluded from the header list. @joeBumbaca is correct that you need to set this explicitly to true
and false
to keep it in the header list.
1 Like