# Perspective Status Table Filter

**URL:** <https://forum.inductiveautomation.com/t/perspective-status-table-filter/76252>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [July 12, 2023, 11:52am UTC](https://forum.inductiveautomation.com/t/perspective-status-table-filter/76252 "2023-07-12T11:52:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [July 12, 2023, 11:52am UTC](https://forum.inductiveautomation.com/t/perspective-status-table-filter/76252/1 "2023-07-12T11:52:45Z")

</div>

I have been having trouble with using the filterAlarm script configuration on the alarm status table. I have multiple things I want to filter but even the simplist form is not working. I am using print in the console to ensure that the item are being check and are the same I search for but still not working.  
Here is my code:

```auto
def filterAlarm(self, alarmEvent):

	source = alarmEvent.get("source")
	system.perspective.print(source)

	if source == "prov:default:/tag:pilot/Alarm/genProblem:/alm:supProblem":
		system.perspective.print("in the if")
		return True
	else:
		system.perspective.print("in else")
		return False

```

this is my table:

 ![Screenshot (15)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/f/1f8c7841b00b7fb492cc0abac0739f48cb6fe5dd.png)

And when the script is applied everything is return False

Any help would be amazing!

---

<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:** [July 12, 2023, 2:40pm UTC](https://forum.inductiveautomation.com/t/perspective-status-table-filter/76252/2 "2023-07-12T14:40:10Z")

</div>

`alarmEvent.get("source")` isn't returning a string, it's [returning a QualifiedPath object](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.29/com/inductiveautomation/ignition/common/alarming/AlarmEvent.html#getSource()) that happens to _convert_ to the string you specified when asked to do so, such as by `system.perspective.print` (You can confirm this by `system.perspective.print`ing `type(source)`).

So you can either

1. compare strings to strings:  
`if str(source) == "prov:default:/tag:pilot/Alarm/genProblem:/alm:supProblem":`
2. compare qualified paths to qualified paths:

```python
from com.inductiveautomation.ignition.common import QualifiedPath

path = QualifiedPath.parse("prov:default:/tag:pilot/Alarm/genProblem:/alm:supProblem")
if source == path

```

1. Extract the parts you care about from the qualified path:

```python
tag = "pilot/Alarm/genProblem"
alarm = "supProblem"
if source.getPathComponent("tag") == tag && source.getPathComponent("alarm") == alarm:

```

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [July 12, 2023, 3:06pm UTC](https://forum.inductiveautomation.com/t/perspective-status-table-filter/76252/3 "2023-07-12T15:06:44Z")

</div>

Thank you so much I thought it would be something small that I was missing.  
I also had another question about filter and that was if you would be able to filter the table to grab a specific on-call roster and the people in it?

---

<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:** [July 12, 2023, 3:12pm UTC](https://forum.inductiveautomation.com/t/perspective-status-table-filter/76252/4 "2023-07-12T15:12:41Z")

</div>

Tags are globally scoped objects with no 'attachment' to users. You certainly _could_ retrieve a roster in the script, but how are you going to correlate it with a particular tag? A tag can have any number of alarm pipelines, and those pipelines can have any number of notification blocks, and those notification blocks can have dynamic rosters associated with them, so it would be very fragile to tie things together.

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [July 12, 2023, 3:29pm UTC](https://forum.inductiveautomation.com/t/perspective-status-table-filter/76252/5 "2023-07-12T15:29:41Z")

</div>

I have set alarm tags that do not need to be visible to some session users so based on my session props I wanted to have those alarms only be visible to the employees that need to see them so that it is not overwhelming. When designing this I have certain alarms for certain station and therefor supervisors of only their station need to see those alarms and not other supervisors.

I was planning on using either system.alarm.getRosters() based on tag name to compare with the session props. Or system.roster.getRoster() also based on tag name then call getUsers() to get compare to session props.

---

<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:** [July 12, 2023, 3:31pm UTC](https://forum.inductiveautomation.com/t/perspective-status-table-filter/76252/6 "2023-07-12T15:31:21Z")

</div>

If you can guarantee (or at least assume) that something like alarm/tag names indicates strongly who needs to 'care' about certain alarms, then yes, it's definitely doable.

---

<div class="post-metadata">

**Author:** ![Grace\_Tarler](https://avatars.discourse-cdn.com/v4/letter/g/f0a364/32.png) [@Grace\_Tarler](https://forum.inductiveautomation.com/u/Grace_Tarler)\
**Post date:** [July 12, 2023, 3:32pm UTC](https://forum.inductiveautomation.com/t/perspective-status-table-filter/76252/7 "2023-07-12T15:32:33Z")

</div>

Perfect! Just wanted to make sure that I wasn't thinking of something totally out of left field.
