How to add image from my local drive (or location) into Looker dashboard?

  • Looker FAQs
  • January 21, 2018
Get Started Transforming Your Data in Snowflake

We can use the HTML parameter in the LookML of the Dimension / Measure to have Looker render the image. For example:

dimension: tool_name {
  type: string
  sql: ${TABLE}.tool_name;;
  html: <img src="https://logo-core.clearbit.com/looker.com" /> ;;
}

In this case, the text of each row will be replaced by the following image:

Please note : The “img src” tag of HTML can have values of locations like AWS S3, any website, shared drives (dropbox, google drive), etc.

Dynamic Images

To change the images based on the value of the row, we can input the value of the row into the HTML parameter using the Liquid variable {{value}}.

For example:

dimension: homepage_image {
  type: string
  sql: ${TABLE}.tool_name_url;;
  html: <img src="https://logo-core.clearbit.com/{{value}}" /> ;;
}

In the above dimension, the URL changes for each row as we append company URLs to the end of https://logo-core.clearbit.com/, a website that provides various companies’ logo images based on the URLs.

 


Up Next:

Read How to do conditional formatting of color or images within table cells using HTML in Looker?