# Extracting from an array

**URL:** <https://community.glideapps.com/t/extracting-from-an-array/80500>\
**Category:** Ask for Help\
**Created:** [March 4, 2025, 9:41pm UTC](https://community.glideapps.com/t/extracting-from-an-array/80500 "2025-03-04T21:41:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 4, 2025, 9:41pm UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/1 "2025-03-04T21:41:29Z")

</div>

Hello Gliders! I have an array column of numbers, for example: 5, 10, 12  
Today I want to extract the first one, “5”  
Tomorrow the second one, “10”  
Day after tomorrow, “12”  
Thenafter, repeat the cycle again, extracting 5, then 10, then 12, etc, etc.  
I guess I could run a schedule workflow every day, but how do I extract?  
Thanks!

 ![array](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/0/50f3b8d88ae78e31203e52152f6be620b2b98ef5.jpeg)

---

<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:** [March 4, 2025, 11:44pm UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/2 "2025-03-04T23:44:40Z")

</div>

So you have a fixed “start date” for your cycle? Can you explain more about the use case?

It can be done through a single value \> from start \> dynamic index.

---

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 4, 2025, 11:50pm UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/3 "2025-03-04T23:50:47Z")

</div>

Yes, I have a fixed start day (today, through timestamp).

---

<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:** [March 4, 2025, 11:53pm UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/4 "2025-03-04T23:53:53Z")

</div>

I see you have varying lengths of the array there. Do they reset on the same day (so same cycle) or not?

---

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 5, 2025, 12:44am UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/5 "2025-03-05T00:44:34Z")

</div>

Yes, there can be varying lengths. If the array is “3, 5, 2” for example, then I should be able to extract the values like this:

Day1: 3  
Day 2: 5  
Day 3: 2  
Day 4: 3  
Day 5: 5  
Day 6: 2  
Day 7: 3  
Day 8: 5

and so on, repeating the cycle.

---

<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:** [March 5, 2025, 12:53am UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/6 "2025-03-05T00:53:42Z")

</div>

Will different rows have different starting days?

Will the array length change at any point?

---

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 5, 2025, 4:06pm UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/7 "2025-03-05T16:06:50Z")

</div>

Yes, different rows have different starting days. Each row is independent, having a unique array and unique starting date. For each row, the array length and data does not change.

---

<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:** [March 5, 2025, 11:27pm UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/8 "2025-03-05T23:27:33Z")

</div>

Ok here’s my proposed solution.

 ![CleanShot 2025-03-06 at 06.25.29](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/5/f517ec7572efea51d585bddf55d4f0358c91c5f6.png)

From the array, use this to get the array length.

 ![CleanShot 2025-03-06 at 06.25.38](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/5/a5f73f114e200a1d1f794c57705d2f30bf07aada.png)

Use this to calculate the date difference between the start date and now: `TRUNC(N-D)`

 ![CleanShot 2025-03-06 at 06.25.58](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/3/13a953d4fb12c7a45cae8c7df968c33f08ffe54f.png)

Use this to calculate the index of the “current day”: `MAX(MOD(D,C),0)`

 ![CleanShot 2025-03-06 at 06.26.28](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/b/8b0909ee33a694b39a48595e31d6f56c3842d473.png)

And finally this to get the number of the day via the index.

 ![CleanShot 2025-03-06 at 06.26.50](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/f/df4b1a107cedf188dfc032184fae610431ac04b6.png)

---

<div class="post-metadata">

**Author:** ![mbraunperu](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mbraunperu/32/83676_2.png) [@mbraunperu](https://community.glideapps.com/u/mbraunperu)\
**Post date:** [March 6, 2025, 3:57pm UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/9 "2025-03-06T15:57:13Z")

</div>

Wonderful !!!  
Thanks a lot Thinh!!!

---

<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:** [March 13, 2025, 3:57pm UTC](https://community.glideapps.com/t/extracting-from-an-array/80500/10 "2025-03-13T15:57:42Z")

</div>

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