Reading UDT tag values from a named query

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 * from UserContact
) as X 
	LEFT OUTER JOIN UserData ON X.user_id =
	WHERE = (SELECT user_id FROM SensorInfo where sensor_number = :sensornum)

Somehow this sound familiar, I feel I have done that before :face_with_monocle:

There are multiple similar questions on the forum regarding these calculated rosters but none of them have answers. Manual is not helpful either. So I am trying to find a solution here. I have tried to read my UDT tags from my calculated roster expression but it is not working for this type of application I am trying to do.