Images from a Google Form with URL update

BAP
Bronze 4
Bronze 4

Hi everyone,

So I am trying to understand the update regarding the new way to display images on your app that are stored in Google Drive. I assume I need to find the actual name of the file and use a formula to pull it up?

I have an app to track maintenance requests. I have a google form that people fill out with the info about what's broken and I want to make it so people can upload a picture as well. The data shows up in the connected spreadsheet in this form https://drive.google.com/open?id=<Text>

Can someone help explain what the changes are and what I need to do to implement them in my app that uses Google Forms?

Solved Solved
0 7 1,827
1 ACCEPTED SOLUTION

Yes, you can get the file name in order to generate a relative path to the image for it to be available in the app. You'd probably need a script to do this.

Another way might be to utilize the folder-as-a-table feature to pull the whole image folder in as a new table and link them up that way.

View solution in original post

7 REPLIES 7

If you weren't using the uc?export=view trick in the URL to get a direct link to the file, nothing should have changed for you. It doesn't sound like you were.

So, is it just supposed to work then with the kind of link that Google Forms automatically gives them? Like with the open?id= part of the link?

I'm a bit confused what you're asking I guess. Did you have something working before that isn't working now?

The basic sharing link for all gDrive files is not a direct link to the file, that's why people used the uc?export=view trick. In Appsheet, you could use that trick to display images in an Image column, or for the app's icon. But that no longer works. You can still link to the file with a URL column using the basic sharing link that you've got.

Sorry that my questions have been confusing.

I see that I am able to take the url that shows up from the Google Form and make the data type for that column a url. I can then click on the link and see the image.

However, I would like to be able to just see the picture itself and not have to be clicking on links. From what I understood from the documentation about the recent change, if you want to pull an image from Google Drive, you have to know the file name in order to retrieve it and have the image appear in your app.

Is that correct? If so, is there a way to retrieve the file name? Or am I stuck clicking on url links?

Yes, you can get the file name in order to generate a relative path to the image for it to be available in the app. You'd probably need a script to do this.

Another way might be to utilize the folder-as-a-table feature to pull the whole image folder in as a new table and link them up that way.

Ok, thanks for the help. If you know of recourses that you could point me to to write a script like that (I'm not too familiar with App script) and also the folder as a table thing, that would be much appreciated.

Go to the folder where Google Forms submits submissions to obtain the direct URL of each image file. This will allow you to display images supplied through Google Forms in your AppSheet app. Make sure that "Anyone with the link can view" is selected on the link, then copy the direct URL. Put the direct image URLs you found in a new column labeled "Image URL" in your data table within your AppSheet application. If you set the column type to "Image" or "URL" and make sure AppSheet correctly understands and displays these URLs, you may use them to display photos in your app's views. To ensure that photos are presented as expected, test your app. Adapt Google Drive permissions as needed to guarantee that app users can access photographs.