# Reading UDT tag values from a named query

**URL:** <https://forum.inductiveautomation.com/t/reading-udt-tag-values-from-a-named-query/54378>\
**Category:** Ignition\
**Created:** [December 21, 2021, 9:02pm UTC](https://forum.inductiveautomation.com/t/reading-udt-tag-values-from-a-named-query/54378 "2021-12-21T21:02:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkhoshroo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pkhoshroo/32/26801_2.png) [@pkhoshroo](https://forum.inductiveautomation.com/u/pkhoshroo)\
**Post date:** [December 21, 2021, 9:02pm UTC](https://forum.inductiveautomation.com/t/reading-udt-tag-values-from-a-named-query/54378/1 "2021-12-21T21:02:54Z")

</div>

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:

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [December 21, 2021, 9:15pm UTC](https://forum.inductiveautomation.com/t/reading-udt-tag-values-from-a-named-query/54378/2 "2021-12-21T21:15:03Z")

</div>

Somehow this sound familiar, I feel I have done that before 🧐

---

<div class="post-metadata">

**Author:** ![pkhoshroo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pkhoshroo/32/26801_2.png) [@pkhoshroo](https://forum.inductiveautomation.com/u/pkhoshroo)\
**Post date:** [December 21, 2021, 9:19pm UTC](https://forum.inductiveautomation.com/t/reading-udt-tag-values-from-a-named-query/54378/3 "2021-12-21T21:19:56Z")

</div>

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.
