# Handlebar template for tableID

**URL:** <https://forums.losant.com/t/handlebar-template-for-tableid/3348>\
**Category:** Help\
**Tags:** data-table\
**Created:** [October 19, 2020, 11:36pm UTC](https://forums.losant.com/t/handlebar-template-for-tableid/3348 "2020-10-19T23:36:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josh\_Bell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/josh_bell/32/2554_2.png) [@Josh\_Bell](https://forums.losant.com/u/Josh_Bell)\
**Post date:** [October 19, 2020, 11:36pm UTC](https://forums.losant.com/t/handlebar-template-for-tableid/3348/1 "2020-10-19T23:36:01Z")

</div>

Hi  
I am trying to reference a dataTable using handlebar template in my workflow, ideally i want the workflow to loop through a bunch of tables. I cant seem to make the template work, i just get an error table not found, as shown below the name is valid, or is there a different “ID” i need?:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/7/7e18b45ed68a4669885249c1979f12e2dcdbf960.png)

---

<div class="post-metadata">

**Author:** ![Heath](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/heath/32/3036_2.png) [@Heath](https://forums.losant.com/u/Heath)\
**Post date:** [October 20, 2020, 12:29am UTC](https://forums.losant.com/t/handlebar-template-for-tableid/3348/3 "2020-10-20T00:29:55Z")

</div>

Hey @Josh_Bell,

The ID you need is the ID of the data table, not the name.

The best way to get this is to go to the data table, and you can find the ID in the URL:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/9/9c60530c658394f5ead5e55f8dbe0e5ce6fd0725.png)

Optionally, you can use a [Losant API Node](https://docs.losant.com/workflows/data/losant-api/) with the [Data Tables: Get](https://docs.losant.com/rest-api/data-tables/#get) method to get a list of data tables that the application has.

Could you tell me a little more about why you’re looking to loop through multiple data tables? I’d love to learn more about your use case and maybe help you a little more.

Please let me know if this works for you.

Thank you,  
Heath

---

<div class="post-metadata">

**Author:** ![Josh\_Bell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/josh_bell/32/2554_2.png) [@Josh\_Bell](https://forums.losant.com/u/Josh_Bell)\
**Post date:** [October 20, 2020, 1:31am UTC](https://forums.losant.com/t/handlebar-template-for-tableid/3348/5 "2020-10-20T01:31:43Z")

</div>

Hi  
Thanks for that, i figured it would be something to do with the name vs the ID of the table i just didn’t know where to find the ID. Is there a way to return the name of the table with the “Table get rows” node?  
The reason for the loop is to do data analysis on multiple tables in the same workflow.  
I have devices located in different blocks of a building complex reporting states to tables that reflect the block they are in, ie D-block devices report state to the D-block table, A-block to the A-block table etc. This workflow looks up the individual block table and does some time based averaging (as per my feature request) on the data and returns the results to a combined results table, i currently do it with a delay but it doesn’t scale well when I want to add more blocks in the future:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/65adad4e1c5e5f912f9c29dd55e5ddbebca7c554.png)

---

<div class="post-metadata">

**Author:** ![Heath](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/heath/32/3036_2.png) [@Heath](https://forums.losant.com/u/Heath)\
**Post date:** [October 20, 2020, 6:28pm UTC](https://forums.losant.com/t/handlebar-template-for-tableid/3348/7 "2020-10-20T18:28:29Z")

</div>

@Josh_Bell,

Thanks so much for sharing this information!

> Is there a way to return the name of the table with the “Table get rows” node?

Are you looking to use an ID of a table to get the rows, and have the node get the rows, and then return both the result of the node & the name of the table?

Thanks,  
Heath

---

<div class="post-metadata">

**Author:** ![Josh\_Bell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/josh_bell/32/2554_2.png) [@Josh\_Bell](https://forums.losant.com/u/Josh_Bell)\
**Post date:** [October 20, 2020, 7:35pm UTC](https://forums.losant.com/t/handlebar-template-for-tableid/3348/9 "2020-10-20T19:35:26Z")

</div>

Hi

I solved it by creating another table that contains the name and ID of the tables I want to look-up.

It would be good if when you used the “table get rows” node it returned the ID and name of the table as well just so it was in the payload somewhere you could reference it later.

Josh
