Create clickable links to images in Google sheet

Summary

This post describes how to save a clickable link in a Google sheet that will open an image captured through your app. The link created is a Google Drive link, so permissions are based on Google Drive settings. It does not require an anonymously accessible link via AppSheet.

Related topics and limitations

This help article describes how to construct an image url using AppSheet. However, it is only appropriate for non-sensitive content because the links can be accessed anonymously.

This example uses a different approach. When the user adds a record, it triggers an Apps Script function to get the Drive url of the image file and write it back to the sheet

Template and Demo

A few notes:

  1. This is a read-only public sample. You must copy the app into your own account in order to sync new changes to the data source and trigger the automation.
  2. After copying the app into your account, delete the example record. The link in the example record points to a file in my Google Drive. The value of this example is in linking to files stored in your Google Drive.
  3. Apps Script projects do not currently copy with the app. So you'll need to create a copy of that separately and update the automation in your copy of the app.

Description

This a simple example of how to use an Apps Script function to capture the url of a file saved into Drive and write the url back to the app's data source. This supports use cases where people need to access saved photos through the Sheet directly.

Access Permissions

Typically, access permissions for content related to AppSheet apps are controlled through AppSheet. This use case is a bit different. Users are accessing these links directly in the Google sheet rather than through AppSheet. Therefore, access permissions are controlled through Drive. One way to manage this is to grant access to the parent folder of the images. Then anyone with that permission could click any link in the Google sheet and open the image.

6 2 3,508
2 REPLIES 2

In case it's relevant or otherwise of interest to anyone: It's also possible to use Apps Script to set the user permissions for a folder or file in Drive. I've found this handy for managing permissions for files that are needed by the users of an AppSheet app but that are not accessed via AppSheet.

This is a huge help. How can I utilise this to take 10 drive url's, of  the ten pictures I need to take? Each picture will be taken on a separate day. @derekco @dbaum 

Top Labels in this Space