# Iterate through collection

**URL:** https://community.glideapps.com/t/iterate-through-collection/35266
**Category:** Ask for Help
**Created:** [November 29, 2021, 9:15pm UTC](https://community.glideapps.com/t/iterate-through-collection/35266 "2021-11-29T21:15:54Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![ldevalbray](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ldevalbray/32/21556_2.png) [@ldevalbray](https://community.glideapps.com/u/ldevalbray)
#### Post date: [November 29, 2021, 9:15pm UTC](https://community.glideapps.com/t/iterate-through-collection/35266/1 "2021-11-29T21:15:54Z")

</div>

Hello, I would like to know if there is a way to iterate over a whole collection (Glide table) to compute an output (in experimental code, passing the array of items ?)  
Thank you !

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [November 30, 2021, 12:08am UTC](https://community.glideapps.com/t/iterate-through-collection/35266/2 "2021-11-30T00:08:56Z")

</div>

We might need to know more about your use case, but you can pass an array to the code column as an input.

You either have to do a lookup to create an array, or a split text.

---

<div class="post-metadata">

### Author: ![ldevalbray](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ldevalbray/32/21556_2.png) [@ldevalbray](https://community.glideapps.com/u/ldevalbray)
#### Post date: [November 30, 2021, 11:37pm UTC](https://community.glideapps.com/t/iterate-through-collection/35266/3 "2021-11-30T23:37:55Z")

</div>

Thank you very much for your reply !  
If I want to create a column array (in the same table) containing all of the letters of this one column (below), how may I do ?  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/5/757be5b10021b1aa1f51c467a5e395da4a313f0c.png)

Because it seems that the lookup only returns this one letter from the same row and does not append it

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [November 30, 2021, 11:42pm UTC](https://community.glideapps.com/t/iterate-through-collection/35266/4 "2021-11-30T23:42:25Z")

</div>

How are you creating that relation? The end result should be something like “H, M, L, H, H”?

---

<div class="post-metadata">

### Author: ![ldevalbray](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ldevalbray/32/21556_2.png) [@ldevalbray](https://community.glideapps.com/u/ldevalbray)
#### Post date: [November 30, 2021, 11:46pm UTC](https://community.glideapps.com/t/iterate-through-collection/35266/5 "2021-11-30T23:46:36Z")

</div>

Yes exactly ! This is how the relation is configured

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/a/3af86517c93ac94a1af0185cfe42ed3371774a86.png)  
Thanks so much

---

<div class="post-metadata">

### Author: ![ldevalbray](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ldevalbray/32/21556_2.png) [@ldevalbray](https://community.glideapps.com/u/ldevalbray)
#### Post date: [November 30, 2021, 11:47pm UTC](https://community.glideapps.com/t/iterate-through-collection/35266/6 "2021-11-30T23:47:08Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/6/f6dc80107022b65915d1a53c14d9924dacd22e10.png)

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [December 1, 2021, 12:03am UTC](https://community.glideapps.com/t/iterate-through-collection/35266/7 "2021-12-01T00:03:39Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/6/b615534e514036a851d15143d19701d006d50058.png)

I think you can add a lookup to return the “ID” and then a join text column to return a list of all characters.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/3/b3289254b9cbccb106dae5642f0abc20ac6e08ed.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/1/71557dfcba0ad5f4f91afea3b2c91c7594097bf7.png)

---

<div class="post-metadata">

### Author: ![ldevalbray](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ldevalbray/32/21556_2.png) [@ldevalbray](https://community.glideapps.com/u/ldevalbray)
#### Post date: [December 1, 2021, 12:30am UTC](https://community.glideapps.com/t/iterate-through-collection/35266/8 "2021-12-01T00:30:41Z")

</div>

Thank you so much for such help !!  
However, there is something I don’t get … It does not show me ID Lookup in the list …

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/5/355be7b2906625afdc2ad3e2f8e9bd3ce07f2901.png)

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [December 1, 2021, 12:54am UTC](https://community.glideapps.com/t/iterate-through-collection/35266/9 "2021-12-01T00:54:32Z")

</div>

![Inked355be7b2906625afdc2ad3e2f8e9bd3ce07f2901_2_1035x472](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/7/476d7133d490fd3765aa9dc966595d463ba088cd.jpeg)  
With a joint list, you can combine all the previous Lookup ID columns.

---

<div class="post-metadata">

### Author: ![ldevalbray](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ldevalbray/32/21556_2.png) [@ldevalbray](https://community.glideapps.com/u/ldevalbray)
#### Post date: [December 1, 2021, 12:59am UTC](https://community.glideapps.com/t/iterate-through-collection/35266/10 "2021-12-01T00:59:01Z")

</div>

Got it ! I had to create two joined lists, I don’t know why … But it works. A huge thanks !

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/8/98ddf99aa88739cf03489e92d6cfc61b4cc03936.png)

---

<div class="post-metadata">

### Author: ![ldevalbray](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ldevalbray/32/21556_2.png) [@ldevalbray](https://community.glideapps.com/u/ldevalbray)
#### Post date: [December 1, 2021, 1:10am UTC](https://community.glideapps.com/t/iterate-through-collection/35266/11 "2021-12-01T01:10:56Z")

</div>

As a metter of fact, it does not detect the joined lists columns as arrays …

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/4/e47a680c1aefdb3cd0afdb96e89752c10493b45c.png)

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [December 1, 2021, 1:19am UTC](https://community.glideapps.com/t/iterate-through-collection/35266/12 "2021-12-01T01:19:18Z")

</div>

Use the split text to break the join list into an array first before you use the reverse array.

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [December 1, 2021, 3:07am UTC](https://community.glideapps.com/t/iterate-through-collection/35266/13 "2021-12-01T03:07:55Z")

</div>

Seems like your relation was a multiple one. I assume there will ever only be one match so I used a single relation.

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [December 2, 2021, 3:08am UTC](https://community.glideapps.com/t/iterate-through-collection/35266/14 "2021-12-02T03:08:31Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
