# system.alarm.queryStatus source as list

**URL:** <https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 29, 2022, 3:24pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031 "2022-11-29T15:24:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 29, 2022, 3:24pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/1 "2022-11-29T15:24:50Z")

</div>

When using a list in the source, from my tests it looks like no matter what I have in the 2nd index (and on) that the source will evaluate true. For example,

```auto
state = ["ActiveUnacked", "ActiveAcked"]
source = '*MyFolder*', '*Does not matter what goes here*'
alarms = system.alarm.queryStatus(source=source, path=path, state=state)
print alarms

```

Can anyone explain how multiple items in a list for the source is supposed to evaluate? If I use `source` and `path` separately it works, but if I ever want to use 3 items in a list I don't think that would be an option.

[https://docs.inductiveautomation.com/display/DOC81/system.alarm.queryStatus](https://docs.inductiveautomation.com/display/DOC81/system.alarm.queryStatus)

---

<div class="post-metadata">

**Author:** ![avaughn](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/avaughn/32/38972_2.png) [@avaughn](https://forum.inductiveautomation.com/u/avaughn)\
**Post date:** [November 29, 2022, 3:28pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/2 "2022-11-29T15:28:40Z")

</div>

The way it's defined currently, I believe `source` is actually a tuple not a list. Could you try wrapping the value of source in square brackets? So it would then be `source = ['*MyFolder*', '*Does not matter what goes here*']`

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 29, 2022, 3:30pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/3 "2022-11-29T15:30:01Z")

</div>

Sorry, I should have mentioned that, I tried that in the beginning. It doesn't seem to need the brackets, but regardless, I tried with and without.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 29, 2022, 3:38pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/4 "2022-11-29T15:38:57Z")

</div>

Seems to be working for me.  
What do you mean by "will evaluate true" ?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 29, 2022, 3:40pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/5 "2022-11-29T15:40:10Z")

</div>

Will return alarms

---

<div class="post-metadata">

**Author:** ![avaughn](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/avaughn/32/38972_2.png) [@avaughn](https://forum.inductiveautomation.com/u/avaughn)\
**Post date:** [November 29, 2022, 3:41pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/6 "2022-11-29T15:41:57Z")

</div>

Are you just seeing alarms returned that match the first source?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 29, 2022, 3:42pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/7 "2022-11-29T15:42:37Z")

</div>

Yes, it will follow what I have in the first index, but doesn't seem to honor what I have in the second index  
Using 8.1.22

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 29, 2022, 3:43pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/8 "2022-11-29T15:43:56Z")

</div>

Can you swap the order to make sure it isn't something to do with that second source?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 29, 2022, 3:46pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/9 "2022-11-29T15:46:16Z")

</div>

Doesn't seem to make a difference for the order. I am running this test from the script console. Maybe I will try a good ole restart just for giggles.

---

<div class="post-metadata">

**Author:** ![avaughn](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/avaughn/32/38972_2.png) [@avaughn](https://forum.inductiveautomation.com/u/avaughn)\
**Post date:** [November 29, 2022, 3:50pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/10 "2022-11-29T15:50:44Z")

</div>

The results should be a list of alarm events that match any of the source paths. What are the results you're expecting? Are you looking for the resulting alarm events to match both source paths?

---

<div class="post-metadata">

**Author:** ![avaughn](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/avaughn/32/38972_2.png) [@avaughn](https://forum.inductiveautomation.com/u/avaughn)\
**Post date:** [November 29, 2022, 3:51pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/11 "2022-11-29T15:51:16Z")

</div>

I'm testing in the script console on 8.1.22 as well and the results I'm seeing are what I would expect.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 29, 2022, 3:58pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/12 "2022-11-29T15:58:01Z")

</div>

Do you mean you get the same list independently of the order, or that the second source, no matter which one it is, always returns something that looks wrong ?

What's the output of

```python
state = ["ActiveUnacked", "ActiveAcked"]
source = '*source1*', '*source2*'
alarms1 = set(al.source for al in system.alarm.queryStatus(source=source, state=state))

source = '*source2*', '*source1*'
alarms2 = set(al.source for al in system.alarm.queryStatus(source=source, state=state))

print alarms1 ^ alarms2

```

It should be an empty set.

PS: Don't use `source` AND `path`. They do the same thing, so just pick one. Maybe using both at the same time somehow messes things up ?

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [November 29, 2022, 4:06pm UTC](https://forum.inductiveautomation.com/t/system-alarm-querystatus-source-as-list/67031/13 "2022-11-29T16:06:21Z")

</div>

> [@avaughn](#):
>
> The results should be a list of alarm events that match any of the source paths.

Ahh, any, not all. I guess that was my confusion, I thought it was all.
