# Custom Data in Custom Code Block?

**URL:** <https://community.glideapps.com/t/custom-data-in-custom-code-block/75267>\
**Category:** Ask for Help\
**Tags:** custom-code\
**Created:** [July 30, 2024, 7:22am UTC](https://community.glideapps.com/t/custom-data-in-custom-code-block/75267 "2024-07-30T07:22:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_Mentrup](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/joshua_mentrup/32/54600_2.png) [@Joshua\_Mentrup](https://community.glideapps.com/u/Joshua_Mentrup)\
**Post date:** [July 30, 2024, 7:22am UTC](https://community.glideapps.com/t/custom-data-in-custom-code-block/75267/1 "2024-07-30T07:22:47Z")

</div>

Hi there,

I am trying to show a dynamic countdown timer in my Glide app. An example URL for this would be [https://i.countdownmail.com/2eiyph.gif?end\_date\_time=2024-08-02T00:01:00-0800](https://i.countdownmail.com/2eiyph.gif?end_date_time=2024-08-02T00:01:00-0800)

This link is dynamically generated in my Google Sheets database.

Here is what I’ve tried:

- inserting an image with that link. Works for the most part but it seems like the image doesn’t always get loaded properly and shows the wrong countdown. Perhaps it gets indexed and then stays that way (even though it still counts down?). Not sure. The issue is that when I show the event date and the countdown is counting past it (e.g. event date 8/3 and the countdown is counting to 8/17), it defeats the purpose. And the link is correct.
- using Rich Text and a template row. This worked by far the best with no wrong images being loaded. However, on mobile, it’s not loading it at all. I am using the following:

```auto
<div style="display: flex; justify-content: center; align-items: center; height: 100%;">
  <img src="upload://sIlcgIQHlNlJ3bWUdg3VUDAuc02.gif" alt="Image" style="max-width: 50%; height: auto;">
</div>

```

and it shows perfectly on my desktop, but not on any phone or mobile browser.

I was considering using the custom code module with HTML. However, while there is a field to add data above it, I can’t seem to figure out how to use that data inside the HTML.

 ![Screenshot 2024-07-30 at 00.13.57](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/9/495e30dcc7f3efe3c67a5fe9f5b956ffd595a22f.png)

This seems to be the best way, but I can’t find any documentation about it either. Any advice?

---

<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:** [July 30, 2024, 7:53am UTC](https://community.glideapps.com/t/custom-data-in-custom-code-block/75267/2 "2024-07-30T07:53:40Z")

</div>

Consider using this:

> [@Timer Concept](https://community.glideapps.com/t/timer-concept/74092):
>
> Here is a first draft of a timer concept I came up with, similar to what we had with Classic Apps. This uses some USC columns, javascript columns, HTML, and a Web Embed component to function without having to worry about the 10 second limit that we experience within Glide currently. It’s a little bit of setup, but not too terrible. The old timer in classic apps used start time, current time, duration, and some javascript math to work. This follows very similar logic. The buttons set variou…

---

<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:** [July 30, 2024, 12:04pm UTC](https://community.glideapps.com/t/custom-data-in-custom-code-block/75267/3 "2024-07-30T12:04:26Z")

</div>

Since you are looking for a countdown, scroll down in the thread that @ThinhDinh linked to and look for @Himaladin’s posts. My example replicates a timer that counts up (replicating the timer feature from classic apps) and I created that example shortly before Custom Components were invented. Now I think it’s a bit easier using the custom component compared to the way I did it.
