Where can i find `calculateRoster()` in the docs?

been combing the docs trying to find this function for more information on how to use the builder, but the search bar returns nothing. there's examples here and there with builder being used, but nothing on it's signature or an explanation of what it does or how to best use it. :stuck_out_tongue: can someone point me to the right location please?

EDIT: i searched for calculateRoster, builder, builder alarms, alarm calculateRoster, calculateRoster() (just in case), as well as roster builder, email roster builder, and email builder. i case you thought i wasn't thorough... :wink:

Frankly I've never bothered with the builder...
A simple json works well enough that I've never seen the point of going further.

Just make sure to make LISTS of emails:

return [
	{'username': "john", 'email': ["bonzo@ledzep.com"]},
	{'username': "ritchie", 'email': ["r.blackmore@purple.com"]},
	...
]

oooh.... it requires a username AND an email! the guy before just sent a bigass list like this:

return [
    { "email": [ 'dude@place.io', 'bro@thing.com', 'pikachu@zap.net`] }
]

which seemed sus. there's no docs on what is expected on the other end... :stuck_out_tongue:

thanks for this. yeah. i prefer just building my own, but i wanted to read the docs so i could use the builder to figure out what the desired output was. circuitous, but without a doc... whaddya-do? :man_shrugging:

This should also work.
There might be some differences in error handling ? I don't know.

I usually pull the roster from a database, which as a username and addresses... So I just keep that structure in the calculated roster, but the username is not required.
You could probably do the following and it would work just the same:

[
	{'email': "addr1@mail.com"},
	{'email': "addr2@mail.com"},
	...
]

oh. then that make more sense with what the previous dude was trying to do. our installation here is so borked, it isn't funny. but it's working, so untouchable. :stuck_out_tongue: work with what you have, amirite? :face_holding_back_tears:

There are these docs that give the full list of possible dictionary keys and what they take:
https://docs.inductiveautomation.com/display/DOC81/Notification+Block#NotificationBlock-CalculatedRosters
From the link above:
"When putting together a dictionary manually, you can use some or all of the properties listed in the table above. You can create as many dictionaries of users as you want, adding in as much or as little contact info."
Also: "The builder has a set of methods which align with the key:value pairs the dictionary is expecting."

On usernames:
"This can be anything that you want, the user does not have to exist in the Gateway. It will be used for acknowledgement and auditing purposes, so it is important you create meaningful usernames."

I do wish it was explicitly clear on whether a username is required if you don't have any audit logs or acknowledgment set up.

3 Likes

CalulatEDRosterS... :expressionless: of course... thank you @Felipe_CRM

and, yeah, i think i'm just going to default to 'send all the things' because i find it's better to look AT it, than look FOR it :man_shrugging:

1 Like