# filterAlarm against alarmEvent.get('source') vs alarmEvent.get('name')

**URL:** <https://forum.inductiveautomation.com/t/filteralarm-against-alarmevent-get-source-vs-alarmevent-get-name/56535>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 24, 2022, 9:14pm UTC](https://forum.inductiveautomation.com/t/filteralarm-against-alarmevent-get-source-vs-alarmevent-get-name/56535 "2022-02-24T21:14:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BVong](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@BVong](https://forum.inductiveautomation.com/u/BVong)\
**Post date:** [February 24, 2022, 9:14pm UTC](https://forum.inductiveautomation.com/t/filteralarm-against-alarmevent-get-source-vs-alarmevent-get-name/56535/1 "2022-02-24T21:14:05Z")

</div>

I can see the alarmEvent on the console just fine. There is the source property that would like to do a contains against.

The below works fine:  
testSt = alarmEvent.get(‘name’)  
system.perspective. print(testSt)  
if testSt. **contains** (“Sample\_Tags”):  
system.perspective. print(“Yes”)  
else:  
system.perspective. print(“No”)  
return False

When I change to use ‘source’ vs ‘name’:

```
testSt = alarmEvent.get(source)
system.perspective. print(testSt)
if testSt. __contains__ ("Sample_Tags"):
   system.perspective. print("Yes")
else:
   system.perspective. print("No")
return False

```

I get the following error:

com.inductiveautomation.ignition.common.script.JythonExecException  
Traceback (most recent call last):  
File “function:filterAlarm”, line 9, in filterAlarm  
AttributeError: ‘com.inductiveautomation.ignition.common.QualifiedP’ object has no attribute ‘ **contains** ’

```
caused by org.python.core.PyException

```

Traceback (most recent call last):  
File “function:filterAlarm”, line 9, in filterAlarm  
AttributeError: ‘com.inductiveautomation.ignition.common.QualifiedP’ object has no attribute ‘ **contains** ’

Ignition v8.1.13 (b2021122109)  
Java: Azul Systems, Inc. 11.0.13

I want to only permit a certain source to update the alarm table. Thanks in Advance!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 24, 2022, 9:48pm UTC](https://forum.inductiveautomation.com/t/filteralarm-against-alarmevent-get-source-vs-alarmevent-get-name/56535/2 "2022-02-24T21:48:43Z")

</div>

> [@BVong](#):
>
> AttributeError: ‘com.inductiveautomation.ignition.common.QualifiedP’ object has no attribute ‘ **contains** ’

`event.source` is not a string, it's a [`QualifiedPath`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.14/com/inductiveautomation/ignition/common/QualifiedPath.html) object.  
You can call `toString()` or `toStringSimple` (mentioned in the link above) or wrap it in `str` (a Python builtin) to convert it to a string, or, potentially, use one of the richer object methods detailed above.
