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?
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:
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.
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
The table looked something like this:
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.