Links to images - the easy way

The situation
A larger number of companies (>100) must be shown in the app
An image of the company must be shown in list/title and detail views
Sometimes the list will be using circular images and sometimes square images
The detailed view could be using small, medium, large images of the company
Right now I’m using G-drive to host the images
In order to link to the specific image in G-drive then the image must be made sharable and the link copied to G-sheet.

The challenge
When you have to obtain a larger number of links and insert in the correct cells in G-sheet then you will end up doing the same thing again and again. This must be possible to automate - and I guess that some of the great people in the community could point me in the right direction.

NB: I want the images on my own account (and not directly upload to Glide) as I want to have the full control of the images whereabouts

What I’m doing right now

If I wasn’t working with G-drive links, I would create similar names for the images and thereby easily create the links:
Company: X
Circular image: X_circ.png
Square image: X_square.png
Small image: X_small.png
Medium image: X_medium.png
Large image: X_large.png

Link could look like: https://…/images/X_circ.png

Certainly not an answer, but close to same topic with a bit of blasphemy by invoking names that shall not be spoken.

Also dated but interesting use of image functions.

I don’t know if this does everything you want, but I found this:

1 Like

I prefer the first of two answers on that page. Learning to script would take me longer than going out and taking all new pictures.

Yes, you can select all these files and get shareable links to them at once.

  1. Select files
  2. Right-click any of them and pick “Share…” out of the context menu.
  3. Click “Get shareable links” in the upper right corner of the Share dialog window. This does several things at once: makes files accessible to anyone with a link, and copies the links to your clipboard.
  4. Paste into the spreadsheet. The copied links are newline-separated, so when pasted into a spreadsheet, they form a neat column.

@Jeff_Hager Thx for input. I will consider whether I should start to take up scripting - know it will be useful in the future

@Les_Henderson Also thx for input. I might just do the simple version as you also preferred. Now I just need to find out how to get the names for the files - I wonder whether that is as easy as getting the urls - well, I haven’t figured that out yet. So any suggestions would be great :slight_smile:

You could consider an addon like this:

@Jeff_Hager I also considered this script ( - but i’m afraid that I’m not at a level where I get it to work. When calling the script (like =listFilesInFolder(“zswzs8hL8toQmzds1Iof6svWoCW-zwdfsd”) I’m told that I don’t have permissions. ‘You do not have permission to call DriveApp.getFoldersByName. Required permissions: ( || (line 8).’

I tried the add-on you mentioned but it is verified so you cannot use google sign inf

Thx for trying to help me :slight_smile:

Did you get a screen to allow permission? I tend to stay away from scripts as much as I can, so I don’t have much experience with them. It’s more of an ‘I don’t want to learn them’ kind of attitude. I can do them, but they are time consuming. I don’t have much more info for you other that what I’m finding using google searches.

@Jeff_Hager Thx for helping me out.

I found out that the following script can give the name of the file, url and more stuff.

Inspiration found here (but for some reason I couldn’t get it to work)

  function listAllFilesInFolder() {
  var folderId = 'xxx id of the folder xxx'; //id of the folder
  var files = DriveApp.getFolderById(folderId).getFiles();
  var  sheet = SpreadsheetApp.getActiveSheet();

  sheet.appendRow(["Name", "Date", "Size", "URL", "Download", "Description"]);

  while (files.hasNext()) {
    var file =;
    var data=file.getName();
    data = [ 
      "" + file.getId(),

@Krivo Take a look at this spreadsheet and the Google Script attached. Make a copy of it and place folder with other files in your Google Drive. You can run the function listAllFilesInFolder() in the Script Editor -or- I created a menu for it. [:gift: Glide Community Demo Scripts/List all Files at this Spreadsheets Location] Do not rename the sheet at the script relies on it and will only overwrite data on that sheet name. You will have to allow it to run when you get those warning messages about it being a authorized google script.

1 Like