# Alarm Pipeline Notification Calculated Roster: access pipeline properties

**URL:** <https://forum.inductiveautomation.com/t/alarm-pipeline-notification-calculated-roster-access-pipeline-properties/16976>\
**Category:** Ignition\
**Created:** [February 14, 2018, 1:10am UTC](https://forum.inductiveautomation.com/t/alarm-pipeline-notification-calculated-roster-access-pipeline-properties/16976 "2018-02-14T01:10:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 14, 2018, 1:10am UTC](https://forum.inductiveautomation.com/t/alarm-pipeline-notification-calculated-roster-access-pipeline-properties/16976/1 "2018-02-14T01:10:57Z")

</div>

I have an alarm notification profile that has been setup as per the Escalation pipeline in the user manual ([https://docs.inductiveautomation.com/display/DOC79/Pipeline±+Escalation](https://docs.inductiveautomation.com/display/DOC79/Pipeline+-+Escalation))

Instead of sending an SMS to all users within a roster at once, I want to send an SMS to each user in the roster sequentially after the delay period. E.g. if i have 3 users in the roster, then numCalls would need to increment from 0 to 2 and the pipeline would SMS user 1, wait, then user 2, wait, then user 3, wait, then finally move on to the next escalation.

I presume this must be done as a calculated roster that will return only one contact dictionary at a time each time the notification block is called, incrementing the user each time it is called.

So I have some test code so far in the Notification → Contact → Calculated roster type script:

```auto
users = []
users.append({"username":"Nick", "phone":["22222222222"]})
users.append({"username":"Bob", "phone":["1111111111111"]})
userIndex = event.source.numCalls
roster = [users[userIndex]]
return roster

```

and this pipeline:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/28f2f0c1901f24fb70b3a6c4c6d5643061d2adda.png)

However, `userIndex = event.source.numCalls` doesn’t work as event is the alarm event, rather than the alarm pipeline object…

How can I access the numCalls property of the pipeline within this function?

Cheers!  
Nick

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 14, 2018, 1:21am UTC](https://forum.inductiveautomation.com/t/alarm-pipeline-notification-calculated-roster-access-pipeline-properties/16976/2 "2018-02-14T01:21:32Z")

</div>

Nevermind, I have the dumb…

‘event’ is a PyAlarmEvent object which has a ‘get’ method to access the alarm pipeline’s properties.

E.g. I can use event.get(‘numCalls’) to get the current numCalls value.

---

<div class="post-metadata">

**Author:** ![gmiroclosa](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gmiroclosa/32/21572_2.png) [@gmiroclosa](https://forum.inductiveautomation.com/u/gmiroclosa)\
**Post date:** [December 16, 2021, 1:43pm UTC](https://forum.inductiveautomation.com/t/alarm-pipeline-notification-calculated-roster-access-pipeline-properties/16976/3 "2021-12-16T13:43:09Z")

</div>

Hi,  
Only for information:  
A **system.db.runNamedQuery** NOT WORKS into Roster calculated mode.  
I change the query to:  
system.db.runQuery  
And it goes right.  
If someone else try it and could solve the issue, please, let me know.

---

<div class="post-metadata">

**Author:** ![Allen\_Miller](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/allen_miller/32/43816_2.png) [@Allen\_Miller](https://forum.inductiveautomation.com/u/Allen_Miller)\
**Post date:** [March 10, 2023, 11:41pm UTC](https://forum.inductiveautomation.com/t/alarm-pipeline-notification-calculated-roster-access-pipeline-properties/16976/4 "2023-03-10T23:41:32Z")

</div>

Also adding information for reference:

While `system.db.runNamedQuery` does not work in a notification block's calculated roster script, you can do the following:

- Call `system.db.runNamedQuery` in a script block
- Store the result in an event prop
- Reference that prop in the notification block

For example, on the script block:

```py
results = system.db.runNamedQuery('path/to/myQuery')
event.set('results', results)

```

and on the notification block's calculated roster script:

```py
results = event.get('results')

```

---

<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:** [March 10, 2023, 11:54pm UTC](https://forum.inductiveautomation.com/t/alarm-pipeline-notification-calculated-roster-access-pipeline-properties/16976/5 "2023-03-10T23:54:39Z")

</div>

It feels very plausible to me that `runNamedQuery` actually would work fine, you just need to specify the _project_ name as the first argument (see the gateway scoped section):  
[https://docs.inductiveautomation.com/display/DOC81/system.db.runNamedQuery](https://docs.inductiveautomation.com/display/DOC81/system.db.runNamedQuery)

We could absolutely _fix_ that, though, so that the project name is assumed from context.

---

<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:** [March 11, 2023, 12:07pm UTC](https://forum.inductiveautomation.com/t/alarm-pipeline-notification-calculated-roster-access-pipeline-properties/16976/6 "2023-03-11T12:07:35Z")

</div>

> [@paul-griffith](#):
>
> We could absolutely _fix_ that, though

Poor choice of argument order. ☹

---

<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:** [March 11, 2023, 5:50pm UTC](https://forum.inductiveautomation.com/t/alarm-pipeline-notification-calculated-roster-access-pipeline-properties/16976/7 "2023-03-11T17:50:39Z")

</div>

8.3's coming, and I've got lots of leeway to right wrongs in scripting. Obviously backwards compatibility is important, but I'm hoping to make the whole system namespace a lot more clear and consistent.
