A button to update a GIF image

Hello. I’m creating a simple mobile app using Glide.

I’m working on a page that consists of a moving GIF image and a button.
What action should I use to update (reset to the initial state) the image every time the button is pressed?
I tried setting the Set Column Value, but I couldn’t understand it well. .

Thank you in advance.

When you say a moving GIF, I assume you mean an animated GIF?
I’m not sure how you would “reset” that - perhaps you could use an action that toggles a visibility condition to temporarily hide and then show the image?

1 Like

I want to reset an animated GIF (approximately 30 seconds in duration) to its initial frame (0.00 seconds) every time I press a button.

I do not mean to hide or show it based on conditions.
What methods are available for achieving this?

I’m not aware of a simple way to do this, certainly Glide doesn’t provide any built in capability that would do it.

Perhaps something you could try would be to alter the URL of the GIF by attaching a dummy parameter to the end with the button click. I expect this would trigger the client device to reload the image, which would in effect reset it.

The way you would do that would be to first create a template column that concatenates the Image and the current date/time value. Then on your button action, use a Set Column Values action to update the image URL using the value in the template column.

The template column would look something like the following:

And it would give you a value something like:

https://storage.googleapis.com/glide-staging.appspot.com/uploads-v2/ZeEfA81C9UEE3YTyyHMo/pub/6MSndKfzoSwrJTjgljzA.jpg?random=18/09/2023, 15:56:50

Because the Glide current datetime value changes every 10 seconds, the value in the template column would also change every 10 seconds.

I can’t guarantee that this would work, but it is worth a try.