Random image display from Google Sheet is inconsistent

Hello,

I am trying to display a single random image at screen start. The images themselves are in my Drive, and the links are in a Google Sheet, and they work. In fact, sporadically, the code works as intended. But only sporadically. Sometimes I load the page and the image comes up and everything is beautiful, but sometimes no image at all.

Images are jpg or png.
Some images do appear to work more frequently than others, but I can’t see what they have in common (they aren’t smaller files, they aren’t all jpg/png, etc.)

Here are my blocks – any thoughts? Thanks so much!

I recommend three changes:

  1. Don’t host images in Google Drive. If you do, make sure they are publicly available links.

  2. Set a label’s text to app variable meme so that you can see what the url is that gets retrieved each time the screen opens. Better yet, set a text input’s text to that variable so that you can then copy and paste the url into an incognito window in your browser to make sure that anyone who uses the app can view the image(s) from their url(s).

  3. Don’t have multiple event blocks for the same event. You have two events blocks for the “new to menu img3” component being clicked. How do you know if the app value gets changed before or after the navigate block fires? You don’t!

2 Likes

Thanks for that tip – I have no idea why some of the links are available to anyone and others aren’t but I will tackle that problem!

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