# Pulling in images for streaks

**URL:** https://community.glideapps.com/t/pulling-in-images-for-streaks/24403
**Category:** Ask for Help
**Created:** [March 17, 2021, 2:56pm UTC](https://community.glideapps.com/t/pulling-in-images-for-streaks/24403 "2021-03-17T14:56:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![John\_Burdine\_Jr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/john_burdine_jr/32/9776_2.png) [@John\_Burdine\_Jr](https://community.glideapps.com/u/John_Burdine_Jr)
#### Post date: [March 17, 2021, 2:56pm UTC](https://community.glideapps.com/t/pulling-in-images-for-streaks/24403/1 "2021-03-17T14:56:05Z")

</div>

With Robert’s help I’ve built a streak counter (I call it “chore chains”) in my app. I had a designer make a series of images of a silver chain getting more and more links turning gold. I want the proper image to become visible based on the length of the current streak. This is all easy enough if I insert all the image components and source them using a URL and then setting the visibility set for each one to match the current streak. However, I’m trying to speed up load times and the dependability of the images so I’d like to load them into glide instead of using a URL. This tab uses the USER sheet, and I can’t figure out where exactly to load the images so I can reference them. I tried using my Lists tab and creating a relation but it’s not showing as an option for the image components. Any help?

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 17, 2021, 3:09pm UTC](https://community.glideapps.com/t/pulling-in-images-for-streaks/24403/2 "2021-03-17T15:09:16Z")

</div>

Where are the images stored now?

If you create an image column, you can upload an image directly into that column, or you can use an image picker to upload an image as well. The thing is, the image will be uploaded to Glide storage, but I’m not sure how much it would speed things up. You still end up with a url of the image to Glide’s storage. What happens in an app is that each user’s device needs to download and cache that image from the url, so it may still have some initial lag. It may or may not load faster depending on the quality of the storage server you are currently using for your images. I’d still recommend storing in glide though.

What I would maybe do is create a new sheet for image resources. Then in your user sheet use the streak count value to create a single relation to the image resource sheet. Then create a lookup column to get the image url. Your image component can then point bro that lookup column to display the corresponding image.

---

<div class="post-metadata">

### Author: ![John\_Burdine\_Jr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/john_burdine_jr/32/9776_2.png) [@John\_Burdine\_Jr](https://community.glideapps.com/u/John_Burdine_Jr)
#### Post date: [March 17, 2021, 4:55pm UTC](https://community.glideapps.com/t/pulling-in-images-for-streaks/24403/3 "2021-03-17T16:55:14Z")

</div>

> **[DIY Legends · Glide](https://www.loom.com/share/7d05abb3ba894ff2ae3c7fbe51d66646)**
>
> Check out a video I made via Loom

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [March 17, 2021, 5:45pm UTC](https://community.glideapps.com/t/pulling-in-images-for-streaks/24403/4 "2021-03-17T17:45:21Z")

</div>

Yeah, what the relation shows is a little weird. I think it’s either supposed to be the first column in the row, or the column before or after the the column you link to. Not really sure. I’ve seen different results, and maybe it varies if you’ve shuffled columns around. Either way, as you’ve noticed, it doesn’t really matter. It’s just telling you that it found a matching row.

To have your streak reset, I’m not sure how you track a streak right now. I’m assuming date comes into play? You could probably do something like an IF column that checks if the last date is more than 1 day prior to today’s date, then return 0, else return the current chain value. Then use that IF column for your relation.

As for image compression, I believe Glide does optimize images automatically…at least in certain circumstances…depending on the browser and if the image is being shown in an image component, or list, or some other view. There’s some basic info below.

> **[Glide Docs](https://www.glideapps.com/docs)**
>
> Welcome to Glide Docs, a steadily growing collection of articles and videos on how to use Glide. We can’t wait to see what you build!

> [@Externally Served Media Routes](https://community.glideapps.com/t/externally-served-media-routes/15020/2):
>
> Glide optimizes and caches all images. There’s no way to disable this at the moment.
