Can someone please help me with this. I am trying to bind this query to an integer custom property. I have spent 2 days on this trying to figure out why am getting errors. I wanted to filter through associated data.
I frist started with this
toInt(runScript(“system.alarm.queryStatus(state=[‘ActiveUnacked’], includeSystem=False, all_properties=[(‘Audience’,’=’,‘Mine’)])”
and
runScript("len(system.alarm.queryStatus(state=[‘ActiveUnacked’], includeSystem=False, all_properties=[(‘Audience’,’=’,‘Mine’)]))
got this error
15:26:27.700 [AWT-EventQueue-2] ERROR com.inductiveautomation.factorypmi.designer.property.configurators.ExpressionConfigurator - Syntax Error on Token: ‘End of Expression’ (Line 0 , Char 0)
This works query runs as script but not as expression.
Also is there anyway to poll from a script? Thank You.
Another approach would be to set up a gateway event script on a timer that queries alarm status on your desired polling schedule, and writes the relevant info out to a tag that you can bind to from your UI.
Thanks a lot. I actually figured the syntax error. it also seem like you have to have at least 2 parameters for it the query to run. I will definitely keep the script in mind for future alarming needs. I know I have a bunch to come so I'll simplify it through this. Thanks again.