I want to return true if any of the valves are open
When I do the following:
{value}["Valves"][0] = "Open"
Result: true
When I do the following:
indexOf({value}["Valves"],"Open")
Result: -1
Can someone explain what I am doing wrong or what assumptions I have that are incorrect? I also tried checking the typeOf({value}["Valves"][0] and it is a string...
I'm bummed that there is no clean native solution. I am going to install your module to test it out, but I am unable to do a gateway restart at this time so I cannot test it out. Thank You for your work on this module.
I don't think it's that recent because according to the 8.1 documentation indexOf | Ignition User Manual it says that it can take a list or tuple and it shows that documentation was last updated jan 13, 2025.
Most other contexts, if you're dealing with a list of values, it's a QualifiedValue over a list.
Expression structure bindings chained into a transform, for whatever reason, are a QualifiedValue containing a list of qualified values.
The indexOf function implementation unpacks the right hand side 'needle' into "Open", but doesn't touch the lhs/haystack, so the index checking doesn't work.
We already have code to unpack arrays of nested qualified values, we just need to add a branch for lists.