# How to template with a loop

**URL:** <https://forums.losant.com/t/how-to-template-with-a-loop/4571>\
**Category:** Help\
**Tags:** workflow\
**Created:** [June 3, 2022, 5:50pm UTC](https://forums.losant.com/t/how-to-template-with-a-loop/4571 "2022-06-03T17:50:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Calderon](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@Jonathan\_Calderon](https://forums.losant.com/u/Jonathan_Calderon)\
**Post date:** [June 3, 2022, 5:50pm UTC](https://forums.losant.com/t/how-to-template-with-a-loop/4571/1 "2022-06-03T17:50:57Z")

</div>

Hello Losant Team.

I have a Loop and inside it i have a Math Node with this:  
{{data.itemLoop.value.valueToSum}} - {{data.listETr.[(data.itemLoop.index)].value}}  
listETr is an array that contain the same length that the array that i provided to the loop node and i triyng to do some like this “listETr[i].value”. Is this possible in Losant?

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [June 3, 2022, 6:20pm UTC](https://forums.losant.com/t/how-to-template-with-a-loop/4571/2 "2022-06-03T18:20:04Z")

</div>

There is indeed: the [`{{lookup}}` helper](https://handlebarsjs.com/guide/builtin-helpers.html#lookup). This is actually a native Handlebars helper that is supported within Losant.

So, if you’re iterating over the array `data.itemLoop` and want to pull a value from `data.listETr` dependent on which iteration you’re on, you can reference that value like so:

```handlebars
{{lookup data.listETr data.itemLoop.index}}

```

If that item resolves to an object - as in, you can nest multiple `{{lookup}}` helpers to get what you’re after …

```handlebars
{{lookup (lookup data.listETr data.itemLoop.index) 'value'}}

```
