# Ignition Query Tag Lookup Command

**URL:** <https://forum.inductiveautomation.com/t/ignition-query-tag-lookup-command/16641>\
**Category:** Ignition\
**Created:** [January 18, 2018, 6:34pm UTC](https://forum.inductiveautomation.com/t/ignition-query-tag-lookup-command/16641 "2018-01-18T18:34:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![echaote](https://avatars.discourse-cdn.com/v4/letter/e/f0a364/32.png) [@echaote](https://forum.inductiveautomation.com/u/echaote)\
**Post date:** [January 18, 2018, 6:34pm UTC](https://forum.inductiveautomation.com/t/ignition-query-tag-lookup-command/16641/1 "2018-01-18T18:34:38Z")

</div>

I am trying to setup a query tag to look for the status of a part within a table that was created by a transaction group. The transaction group table’s name is “BirthCertificates” within the Data source “SerialDatabase”  
I have made a new Query tag with data type Integer. In the SQL Query tab I have entered the following:  
lookup({Root Container.BirthCertificates.data}, “TESTSERIAL”, 3, “SerialNumber”, “Status”)  
And selected “SerialDatabase” from the Datasource drop down menu  
The tag diagnostics show an invalid tag path, leading me to believe I have setup the dataset field of the lookup query incorrectly, if anyone has some syntax suggestions I would appreciate it. Was basing my syntax off of the following: [https://docs.inductiveautomation.com/display/DOC79/lookup](https://docs.inductiveautomation.com/display/DOC79/lookup)  
Using Ignition 7.9.1

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 18, 2018, 7:40pm UTC](https://forum.inductiveautomation.com/t/ignition-query-tag-lookup-command/16641/2 "2018-01-18T19:40:08Z")

</div>

lookup() is an expression function. You must use SQL in a query tag, and expression functions in expression tags. And there’s no root container available, wether a Query or Expression, as they don’t execute in any client scope where a window’s root container would be present. Take a look at the Inductive University module on [Query Tags](https://www.inductiveuniversity.com/video/creating-query-tags).
