# Links to images - the easy way

**URL:** <https://community.glideapps.com/t/links-to-images-the-easy-way/2332>\
**Category:** Ask for Help\
**Created:** [November 23, 2019, 3:53pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332 "2019-11-23T15:53:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)\
**Post date:** [November 23, 2019, 3:53pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/1 "2019-11-23T15:53:54Z")

</div>

**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

| | | | | | |
| --- | --- | --- | --- | --- | --- |
| company | Circular image | Square image | Small image | Medium image | Large image |
| Dow | ([https://drive.google.com/open?id=1fvXq3nHFFFPJdoPvhS](https://drive.google.com/open?id=1fvXq3nHFFFPJdoPvhS)) | [https://drive.google.com/open?id=1fvXq3nHFFFPJdoP](https://drive.google.com/open?id=1fvXq3nHFFFPJdoP) | [https://drive.google.com/open?id=1fvXq3nHFFFPJd](https://drive.google.com/open?id=1fvXq3nHFFFPJd) | | |

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

---

<div class="post-metadata">

**Author:** ![Les\_Henderson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/les_henderson/32/1142_2.png) [@Les\_Henderson](https://community.glideapps.com/u/Les_Henderson)\
**Post date:** [November 24, 2019, 12:23am UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/2 "2019-11-24T00:23:22Z")

</div>

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

> **[Display images from Google Drive](https://support.awesome-table.com/hc/en-us/articles/115002196665-Display-images-from-Google-Drive)**
>
> Using images in Awesome Table is pretty common and it can be inserted either via a template or by using the ImageType keyword. Images stored on publicly hosted websites are the popu...

Also dated but interesting use of image functions. [https://www.youtube.com/watch?v=NQCusejfCI4](https://www.youtube.com/watch?v=NQCusejfCI4)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 24, 2019, 4:51pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/3 "2019-11-24T16:51:49Z")

</div>

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

> <https://webapps.stackexchange.com/questions/88769/get-share-link-of-multiple-files-in-google-drive-to-put-in-spreadsheet>

---

<div class="post-metadata">

**Author:** ![Les\_Henderson](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/les_henderson/32/1142_2.png) [@Les\_Henderson](https://community.glideapps.com/u/Les_Henderson)\
**Post date:** [November 24, 2019, 5:12pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/4 "2019-11-24T17:12:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)\
**Post date:** [November 24, 2019, 5:30pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/5 "2019-11-24T17:30:24Z")

</div>

@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 🙂

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 24, 2019, 5:55pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/6 "2019-11-24T17:55:19Z")

</div>

You could consider an addon like this:

[https://gsuite.google.com/u/0/marketplace/app/drive\_links\_exporter/896689929574](https://gsuite.google.com/u/0/marketplace/app/drive_links_exporter/896689929574)

---

<div class="post-metadata">

**Author:** ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)\
**Post date:** [November 24, 2019, 6:05pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/7 "2019-11-24T18:05:46Z")

</div>

@Jeff_Hager I also considered this script ([https://ctrlq.org/code/19854-list-files-in-google-drive-folder](https://ctrlq.org/code/19854-list-files-in-google-drive-folder)) - 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: ([https://www.googleapis.com/auth/drive.readonly](https://www.googleapis.com/auth/drive.readonly) || [https://www.googleapis.com/auth/drive](https://www.googleapis.com/auth/drive)) (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 🙂

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 24, 2019, 7:13pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/8 "2019-11-24T19:13:07Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Krivo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/krivo/32/5363_2.png) [@Krivo](https://community.glideapps.com/u/Krivo)\
**Post date:** [November 24, 2019, 9:48pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/9 "2019-11-24T21:48:31Z")

</div>

@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)

> **[Generate List of all Files in a Google Drive Folder](https://ctrlq.org/code/19854-list-files-in-google-drive-folder)**
>
> This is like running the \`ls\` Linux command for listing all the files and their details in a particular Google Drive folder. You an even make a tree of files. Call the listFiles method with the Dri…

```
  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.clear();
  sheet.appendRow(["Name", "Date", "Size", "URL", "Download", "Description"]);

  
 
  while (files.hasNext()) {
    var file = files.next();
    Logger.log(file.getName());
    Logger.log(file.getUrl());
    var data=file.getName();
    Logger.log(data);
    
    data = [ 
      file.getName(),
      file.getDateCreated(),
      file.getSize(),
      file.getUrl(),
      "https://docs.google.com/uc?export=download&confirm=no_antivirus&id=" + file.getId(),
      file.getDescription(),
    ];
    sheet.appendRow(data);
    
  }
}
```

---

<div class="post-metadata">

**Author:** ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)\
**Post date:** [November 24, 2019, 11:46pm UTC](https://community.glideapps.com/t/links-to-images-the-easy-way/2332/10 "2019-11-24T23:46:16Z")

</div>

@Krivo Take a look at this [spreadsheet](https://docs.google.com/spreadsheets/d/1_o_WIdCckG1_Dp6jartK8h_cxUa8mvz9FdGSSaWch8E/edit?usp=sharing) 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. [🎁 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.
