# Start array of images at specific index and then loop through back to that image

**URL:** <https://community.glideapps.com/t/start-array-of-images-at-specific-index-and-then-loop-through-back-to-that-image/68895>\
**Category:** Ask for Help\
**Created:** [December 20, 2023, 6:50pm UTC](https://community.glideapps.com/t/start-array-of-images-at-specific-index-and-then-loop-through-back-to-that-image/68895 "2023-12-20T18:50:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Jones](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/chris_jones/32/62760_2.png) [@Chris\_Jones](https://community.glideapps.com/u/Chris_Jones)\
**Post date:** [December 20, 2023, 6:50pm UTC](https://community.glideapps.com/t/start-array-of-images-at-specific-index-and-then-loop-through-back-to-that-image/68895/1 "2023-12-20T18:50:17Z")

</div>

I have images in a table (each a separate row). Then I have created a relation to itself to create an array of those related images. I want the user to be able to click on a specific image in the gallery (grid collection) which will open up an overlay with a clickable gallery starting with that specific image. Then I want them to be able to click through that gallery from that image and loop through to the images prior to it. I was able to Slice the array to open to the image and get all the images after it, but I can’t figure out how to access the images prior to the one they clicked on. Any suggestions how I might do this?

---

<div class="post-metadata">

**Author:** ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)\
**Post date:** [December 20, 2023, 6:58pm UTC](https://community.glideapps.com/t/start-array-of-images-at-specific-index-and-then-loop-through-back-to-that-image/68895/2 "2023-12-20T18:58:49Z")

</div>

Not exactly what you want, but perhaps Amit’s (@sardamit) setup will give you ideas.

[How to Create an Image Gallery & Carousel](https://youtu.be/378_OQQb4Pw?si=cUJPz1P-hO_JNdTH)

---

<div class="post-metadata">

**Author:** ![Chris\_Jones](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/chris_jones/32/62760_2.png) [@Chris\_Jones](https://community.glideapps.com/u/Chris_Jones)\
**Post date:** [December 20, 2023, 7:06pm UTC](https://community.glideapps.com/t/start-array-of-images-at-specific-index-and-then-loop-through-back-to-that-image/68895/3 "2023-12-20T19:06:37Z")

</div>

Ok, thanks for the reply. I’ll take a look.
