How do you get images from a spreadsheet and display them in MIT App Inventor?

Do i need to add a web component for the image to displayed?

This will depend on what you are doing. If you need to get the data from the google sheet, then yes, you will need to use a web component.

i want to display the image in a imagebox

Why do you want to get images from spreadsheet instead of directly from gdrive ?

As i want to change the urls regularly

if so, Add the image in gdrive or fooder, copy the image URL as you like and paste in this spreadsheet. Then call this url into your app

so would i need a web component to display the image

I have answered this already.

You somehow need to get the image file IDs into the app. If you have these stored in your google sheet, then you need to fetch this data. You would use the web component to do this. Once you have a list of file Ids, you can assign these to an image/canvas/other component for viewing the image.

sory i am a bit confused could you show me a full example

Can you explain better ?

image

Ensure that your spreadsheet and images are "public"/"anyone with the link", otherwise you will need a google apps script web app to access the files on your google drive.

1 Like

If I understand well, the gsheet works as a list, the images must also be present on gdrive

You understand well.

What is &gid=.... ?

It is the grid ID or sheet number (as opposed to sheet name)

The first sheet, Sheet1, is usually gid = 0 (zero), and is called by default if no other gid is requested and it is the first sheet from the left.

Thanks TIM, your blocks runs well

1 Like

HI my companion app just closes down when i run the code and my tablet says that the app has a bug
Screenshot 2023-01-23 192123

What is the content of cell A1 / output ?

If it is the image in a cell, then you do not appear to have followed anything I have previously presented

Sorry for the confusion, in the cell i have the file id, but it appears that I have typed in the url wrong that caused the error thank you TIMAI2 for your help and patience

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