# Using a dataset to populate calculated roster in alarm pipelines

**URL:** <https://forum.inductiveautomation.com/t/using-a-dataset-to-populate-calculated-roster-in-alarm-pipelines/75771>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 30, 2023, 1:29pm UTC](https://forum.inductiveautomation.com/t/using-a-dataset-to-populate-calculated-roster-in-alarm-pipelines/75771 "2023-06-30T13:29:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![will.glancy](https://avatars.discourse-cdn.com/v4/letter/w/73ab20/32.png) [@will.glancy](https://forum.inductiveautomation.com/u/will.glancy)\
**Post date:** [June 30, 2023, 1:29pm UTC](https://forum.inductiveautomation.com/t/using-a-dataset-to-populate-calculated-roster-in-alarm-pipelines/75771/1 "2023-06-30T13:29:19Z")

</div>

hi all,

at the moment i'm using calculated rosters using an expression where i can have users toggle themselves in and out of the rosters using a perspective component. it just toggles a memory tag that i reference in my calculated expression to populate their contact information in the roster. if true username = user etc.

the problem with this is every time they add a user, i have to go and change all my expressions in all my pipelines. what i was hoping to do is use a dataset to handle the contact info and draw from that in a loop in the calculated contact expression, but i can't figure out how to get from a dataset to a dictionary properly.

has anyone done this successfully?

---

<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:** [June 30, 2023, 1:43pm UTC](https://forum.inductiveautomation.com/t/using-a-dataset-to-populate-calculated-roster-in-alarm-pipelines/75771/2 "2023-06-30T13:43:16Z")

</div>

I used something like this a while ago.  
Have a table with at the very least a text unput for the mail address, and a checkbox to enable/disable receiving notifications.

I'd store that into a database table, but I guess a dataset tag is fine.

Then in the calculated roster script, use something like this:

```python
return [user.address for user in system.dataset.toPyDataSet(your_dataset)]

```

I don't remember exactly what the output should look like, so adapt it to whatever is expected.

---

<div class="post-metadata">

**Author:** ![will.glancy](https://avatars.discourse-cdn.com/v4/letter/w/73ab20/32.png) [@will.glancy](https://forum.inductiveautomation.com/u/will.glancy)\
**Post date:** [June 30, 2023, 1:58pm UTC](https://forum.inductiveautomation.com/t/using-a-dataset-to-populate-calculated-roster-in-alarm-pipelines/75771/3 "2023-06-30T13:58:15Z")

</div>

do you recall the formatting of your table? do you just use header values for username, sms, email, then row values for the info? because it seems to me the dictionary MUST be in the format {"username" : "user", "sms" : "+1xxxxxxx"} etc.

i managed to peel values out of a dataset with a script but in my logs it was upset that it got strings instead of dictionaries

---

<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:** [June 30, 2023, 2:06pm UTC](https://forum.inductiveautomation.com/t/using-a-dataset-to-populate-calculated-roster-in-alarm-pipelines/75771/4 "2023-06-30T14:06:23Z")

</div>

The table looked something like this:

| user | email | phone number | get emails | get sms |
| --- | --- | --- | --- | --- |
| Ritchie | [r.blackmore@purple.com](mailto:r.blackmore@purple.com) | 00000 | | |
| Robert | [Mr.Plant@zeppelin.com](mailto:Mr.Plant@zeppelin.com) | 00000 | | |
| John | [mammoth@zeppelin.com](mailto:mammoth@zeppelin.com) | 00000 | | |

The calculated roster script might be expected to return a list of dicts, that's why I said you'll need to adapt the script to the expected return format.
