# Using filterAlarm and alarmEvent

**URL:** <https://forum.inductiveautomation.com/t/using-filteralarm-and-alarmevent/8835>\
**Category:** Ignition\
**Created:** [July 31, 2014, 9:48pm UTC](https://forum.inductiveautomation.com/t/using-filteralarm-and-alarmevent/8835 "2014-07-31T21:48:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![IronYeti](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ironyeti/32/4124_2.png) [@IronYeti](https://forum.inductiveautomation.com/u/IronYeti)\
**Post date:** [July 31, 2014, 9:48pm UTC](https://forum.inductiveautomation.com/t/using-filteralarm-and-alarmevent/8835/1 "2014-07-31T21:48:38Z")

</div>

I’m trying understand how the alarmEvent.get() function works inside a filterAlarm extension.

I have a ‘line’ UDT comprised of several ‘station’ UDTs. In the station UDT I program several alarms. In order to determine which line an alarm belongs to, in each alarm I add an Associated Data property called ‘linenum’ that is configured with a UDT Parameter (this is an integer parameter passed from the parent line UDT.)

My question is: what type is being returned by alarmEvent(‘linenum’) in the code below? The if clause fails unless I cast it to string; I cannot seem to get int to work (e.g. == 3).

I have this code in an Alarm Status table (in the filterAlarm script):

`def filterAlarm(self, alarmEvent):
	"""
	"""
	linenum = alarmEvent.get('linenum')
	if str(linenum) == "3":	
		return True
	else:
		return False`

---

<div class="post-metadata">

**Author:** ![IronYeti](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ironyeti/32/4124_2.png) [@IronYeti](https://forum.inductiveautomation.com/u/IronYeti)\
**Post date:** [July 31, 2014, 9:59pm UTC](https://forum.inductiveautomation.com/t/using-filteralarm-and-alarmevent/8835/2 "2014-07-31T21:59:12Z")

</div>

From stackoverflow I found this method to get me to use ints. This helps me get past another issue I had with None type being returned on the alarmEvent (if an alarm didn’t have the ‘linenum’ defined).

```auto
alarmline = int(alarmEvent.get('linenum') or 99)
```

The NoneType was probably messing me up in the first place. Tricky little ba$tard.
