I am using an expression function to try and flip a buttons enabled property on and off, based on tags. This is the current expression I have:
if({this.custom.insReady} || {this.custom.prgrm} = 1,
'true',
'false'
)
which returns a true or false correctly, but the true or false it returns makes the property not Boolean anymore and breaks the enabled property. Any ideas how I can fix this?
You're returning strings. You need to return boolean.
if({this.custom.insReady} || {this.custom.prgrm} = 1,
true,
false
)
4 Likes
Welp, that was a silly overlook.... must need some stronger coffee. Thank you!
We've all done it.
And here's another "obvious" simplification now that I think about it:
{this.custom.insReady} || {this.custom.prgrm} = 1
This expression will return a true or false all on its own!
My earlier attempt was effectively saying, "if the expression is true then return a true, otherwise false".
2 Likes