Hello All,
I am trying to set up an alarm notification pipeline with a calculated roster but I have difficulty doing it.
I have 50 instances of a UDT called sensor with the value of being either 0 or 1. Each sensor is assigned to a user to check and this is not unique so for example user A should check sensors 1, 33, and 50. We would like to notify the user when his/her sensor has a value of 0. I have tried to create a named query so that I can use it in my calculated roster to create a roster list but I do not know how to capture the UDT value in my named query. When the sensor value is 0, I want to be able to get its number and then use that to find its associated users and notify them.
My named query:
SELECT
X.email_address,
UserData.username
FROM
(
SELECT * from UserContact
) as X
LEFT OUTER JOIN UserData ON X.user_id = UserData.id
WHERE UserdData.id = (SELECT user_id FROM SensorInfo where sensor_number = :sensornum)