# Table with 2 columns

**URL:** <https://forum.inductiveautomation.com/t/table-with-2-columns/33214>\
**Category:** Ignition\
**Created:** [March 18, 2020, 3:57pm UTC](https://forum.inductiveautomation.com/t/table-with-2-columns/33214 "2020-03-18T15:57:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcamp1](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dcamp1](https://forum.inductiveautomation.com/u/dcamp1)\
**Post date:** [March 18, 2020, 3:57pm UTC](https://forum.inductiveautomation.com/t/table-with-2-columns/33214/1 "2020-03-18T15:57:18Z")

</div>

If I have a table with 2 columns one column is an “ID” and one is “NAME”.  
This table is populated with a dynamic dataset, which only returns the ID and NAME.

When I click on the NAME how do I read the ID value for that name?

I want to use the ID to populate another dataset but can’t make my query because I don’t know how to  
pass the ID value

---

<div class="post-metadata">

**Author:** ![bpreston](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@bpreston](https://forum.inductiveautomation.com/u/bpreston)\
**Post date:** [March 18, 2020, 4:02pm UTC](https://forum.inductiveautomation.com/t/table-with-2-columns/33214/2 "2020-03-18T16:02:20Z")

</div>

You can look up the ID value. Even if you have the ID column hidden you can use something like:

```auto
{Root Container.Power Table.data}[{Root Container.Power Table.selectedRow},0]

```

In the example above, the 0 would be your column number in the dataset. I’m not sure if your using a power table, regular table or what their called but this should be a starting point. I would also wrap it in a try so you can force a value into it if nothing is found.

I’d create a custom property on the table to do this.

---

<div class="post-metadata">

**Author:** ![dcamp1](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dcamp1](https://forum.inductiveautomation.com/u/dcamp1)\
**Post date:** [March 18, 2020, 5:09pm UTC](https://forum.inductiveautomation.com/t/table-with-2-columns/33214/3 "2020-03-18T17:09:13Z")

</div>

Thanks works well!

---

<div class="post-metadata">

**Author:** ![dcamp1](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dcamp1](https://forum.inductiveautomation.com/u/dcamp1)\
**Post date:** [March 19, 2020, 2:18pm UTC](https://forum.inductiveautomation.com/t/table-with-2-columns/33214/4 "2020-03-19T14:18:52Z")

</div>

OK, I just about have this all working together but can’t get pass this part.

In the insertnote function of the “comment panel” I need to take the “Table 1.ValueID” and apply it to this variable ID=Table 1.ValueID

I’m assumming it has something to do with the scope of Table 1.Value because if I use this  
ID=7 or any of my numbers to represent the Inventory ID of the table it will work.

The Table 1.Value is from an expression and is a CUSTOM Property of Table 1

---

<div class="post-metadata">

**Author:** ![dcamp1](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dcamp1](https://forum.inductiveautomation.com/u/dcamp1)\
**Post date:** [March 19, 2020, 5:11pm UTC](https://forum.inductiveautomation.com/t/table-with-2-columns/33214/5 "2020-03-19T17:11:02Z")

</div>

I think I have this finally figured out, will keep you posted.

But thanks again for everybody’s help
