Expression in dashboard blocks

If I use a formula in the expression field, for the blocks that are capable of this, can that formula be within a ctx or other variable ?
My goal is that the experience user should be able to modify this scaling formula based on what type of inputs are used. (4-20mA, 0-10V e.t.c) and sensor range.


Just so I understand your question correctly, are you hoping to use a context variable inside a formula? Or are you asking if a context variable can be a formula with input?

Thank you,

if a context variable can contain the formula.

any update on this here?

Hi @Lars_Andersson,

There is not currently a way to store formulas within a context variable. However, I can make a feature request for this; could you describe how you’d envision this functionality?


Got to thinking about this more, and I since I can use an expression like this:
“{{value1}}* {{ctx.slope}}-{{ctx.intersect}}”
, as long as it is always this formula, it would work, but in case the mathematical characters would need to change, could the “*” and “-” be contained in a ctx variable too?

1 Like