How to add Images to a table in Google Data Studio

How to add Images to a table in Google Data Studio

In this post I’ll show how you can add images to a table in Google Data Studio.

I need to thank Lee Hurst @Helpfullee for introducing me to this method. I came across it in his excellent Data Studio Resource finder.

If you’re interested in this topic you should take a look at ClickInsight’s very good post on the topic, as well as Google Data Studio’s information on adding images.

After some thinking I decided to do something a bit fun with these images, and use them to display the album covers of the Prodigy. Each image is based on a link to the album cover image filed on Wikipedia.

How to add Images to a table in Google Data Studio

For this Data Studio report I decided to create a table in Google Sheets with some simple information about the Prodigy’s studio albums.

This was the Album title, Release Date, number of UK sales, the AllMusic Rating and (importantly for this post) the Image URL.

How to add Images to a table in Google Data Studio

I then added my table as a data source to a new Data Studio report.

How to add Images to a table in Google Data Studio

The next step is to create the Image field that we want to have.

The formula for this is fairly simple:

 IMAGE(Image URL, [Alternative Text])

Parameters:

Image URL – a field or expression that evaluates to a URL.
Alternative Text – (optional) a field or expression that evaluates to Text.

For our Prodigy post, we’ll use a formula like this:

IMAGE(Image URL,Album)
A description of the IMAGE function in Google Data Studio

Therefore the image will be based on the link to the album cover, and the alternative text will be the Album name.

Now that we’ve created our Image dimension our data should look this this:

Our Data Source in Google Data studio.

We can then go into our presentation and add a table with the data set up like this:

The data setup for a table showing images in Data Studio.

And then our table should look something like what is shown below.

A table showing the Prodigy album covers as images in Data Studio.

Hope this was useful!

Download Google Data Studio Templates

If you’d like to download one of my Google Data Studio reports as a template to use for your own data, you can visit Data Studio Templates and purchase one.

Google Data Studio Templates

My Other Blog Posts

Michael

Author Michael

More posts by Michael

Join the discussion 8 Comments

  • Pauline says:

    Hi! Thanks for this explanations. But could you tell us how we add several images?
    I did exactly what you explained and it works for one image, when I create a second image field, the result is not what I expect… The images are not in the good fields…
    Im not sure it’s clear, but if you can help me it would be great 🙂
    Thanks, Pauline

    • Michael says:

      Hi Pauline. Check to make sure the link to the second image is valid. Needs to link directly to the image file. It is possible to have multiple images in a row in a table.

  • Sean says:

    How do you manage to import all of the url for a large number of images??

    Obviously if I have to do it one at a time I won’t!

    Thanks

  • Chirag says:

    Hi there! I’ve added the URLs but the images aren’t loading. The link is from my google drive (the link has editor access). Any clue why this may be happening?

    • Michael says:

      Hi – yes. There is an issue with linking images from Google Drive. For some reason it does not allow it. I’d recommend creating image folders using Imgur (you can set the folder setting to Hidden).

      Otherwise if it has to be from Google Drive try the following (I haven’t tried this myself).

      Here is a script you can add onto a google sheet that will read all the files in the folder and create the image links and thumbnails etc for them . I created it for a project at work – also makes reviewing images in a Drive folder a nicer experience using a simple data studio

      function listFilesInFolder() {

      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var SSID=ss.getId();

      var fileInDrive = DriveApp.getFileById(SSID);
      var parentFolder = fileInDrive.getParents().next();
      var parentFiles = parentFolder.getFiles();
      var parentName=parentFolder.getName();
      var file;
      var data;
      var sheet = ss.getActiveSheet();
      sheet.clear();

      sheet.appendRow([“Name”,”thumb URL”,”ID”,”Date Created”, “URL”,”Download URL”, “Type”, “Last Updated”, “Parent Folder”]);

      // Every file in the folder containing this file.
      while (parentFiles.hasNext()) {
      file = http://parentFiles.next();
      data = [
      file.getName(),
      “https://drive.google.com/thumbnail?id=”+file.getId(),
      file.getId(),
      file.getDateCreated(),
      file.getUrl(),
      file.getDownloadUrl(),
      file.getMimeType(),
      file.getLastUpdated(),
      parentFolder.getName()
      ];

      sheet.appendRow(data);
      }
      };

  • Celestine says:

    Hi, Michael. I’m trying (-and failing) to add images to my table in Data Studio from Sheets. Since I saw your comment re: bug in Drive, I tried imgur — but my images are still not loading 🙁 I also tried getting the link from flaticon but to no avail. Do we have any other work around for this?

    • Michael says:

      Hi Celestine.
      It’s odd that the images from imgur are not working. I’ve never had a problem.

      What type of file are they?
      And are you linking directly to the .jpg or .png file?

Leave a Reply

Do NOT follow this link or you will be banned from the site!