# Check if tag is UDT

**URL:** <https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [June 22, 2022, 1:03pm UTC](https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056 "2022-06-22T13:03:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [June 22, 2022, 1:03pm UTC](https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056/1 "2022-06-22T13:03:42Z")

</div>

If given just a tag path in a script, `[Something]MyTag`, what is the best way to check if this is a UDT instance?

---

<div class="post-metadata">

**Author:** ![nideyijuyidong](https://avatars.discourse-cdn.com/v4/letter/n/7cd45c/32.png) [@nideyijuyidong](https://forum.inductiveautomation.com/u/nideyijuyidong)\
**Post date:** [June 22, 2022, 1:10pm UTC](https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056/2 "2022-06-22T13:10:59Z")

</div>

[system.tag.getConfiguration](https://docs.inductiveautomation.com/display/DOC81/system.tag.getConfiguration)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/5/351c1a23248e049f248d5f621dc85e8653b80b7c.png)

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [June 22, 2022, 7:31pm UTC](https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056/3 "2022-06-22T19:31:16Z")

</div>

Thanks, was curious if there was a more “direct” way,

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 22, 2022, 7:32pm UTC](https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056/4 "2022-06-22T19:32:51Z")

</div>

You could probably read `tagPath.typeId`; if it’s null then it’s not an instance.

---

<div class="post-metadata">

**Author:** ![rbachman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rbachman/32/43718_2.png) [@rbachman](https://forum.inductiveautomation.com/u/rbachman)\
**Post date:** [March 31, 2023, 9:02pm UTC](https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056/5 "2023-03-31T21:02:13Z")

</div>

I think I'm missing something obvious here. How exactly do I use **tagPath.typeId**? Do I use that in conjunction with **system.tag.getConfiguration**?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 31, 2023, 9:05pm UTC](https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056/6 "2023-03-31T21:05:07Z")

</div>

Literally just `system.tag.readBlocking(["path/to/myTag.typeId"])`.

---

<div class="post-metadata">

**Author:** ![rbachman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rbachman/32/43718_2.png) [@rbachman](https://forum.inductiveautomation.com/u/rbachman)\
**Post date:** [April 1, 2023, 5:08am UTC](https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056/7 "2023-04-01T05:08:56Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![Hugh](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@Hugh](https://forum.inductiveautomation.com/u/Hugh)\
**Post date:** [September 24, 2024, 11:12pm UTC](https://forum.inductiveautomation.com/t/check-if-tag-is-udt/61056/8 "2024-09-24T23:12:07Z")

</div>

Is there a way to use this approach to directly check if a tag is a member of a UDT?  
E.g "path/to/myUDT/myTag"  
Currently Im left splitting the string on each "/" and checking if the sub path is a UDT.
