HYPERLINK

Use the HYPERLINK function to create clickable text and image links in tables. Report viewers can click these links to navigate to other pages in your report or on the web.

Sample usage

Create a link to a product catalog page and display the item name as the anchor text:

HYPERLINK(Item URL, Item Name)

Display an image of a product and link to that item's page in your catalog:

HYPERLINK(Item URL, Item Image)

Syntax

 HYPERLINK( URL 
, anchor_text 
)
    HYPERLINK( URL 
, image 
) 

Parameters

  • URL - A field or an expression that evaluates to the URLdata type
  • anchor_text - A field or an expression that evaluates to the Textdata type
  • image - A field or an expression that evaluates to the Imagedata type

The HYPERLINK function has two forms: The first form creates a text link field, and the second form creates an image link field. Text link fields have the Hyperlinkdata type, while image link fields have the Image Linkdata type in your data source. You can add these fields to tables in your reports to give users a way to navigate to other pages.

The HYPERLINK function requires two parameters: the first parameter must be a URL. If the second parameter is a Textfield or expression, the function creates a Hyperlinkfield. If the second parameter is an Imagefield or expression, the function creates an Image Linkfield.

The URL parameter provides the link target (the href portion of the link). The URL parameter can come from existing URL fields in the data source, or the parameter can be an expression that builds URLs from other fields and functions.

The anchor_text parameter specifies the linked text to display. The anchor_text parameter can be from a Textdata type dimension in your data source or any other expression that evaluates to the Textdata type.

To create an Image Linkfield, provide an Imagedimension in your data source or any other expression that evaluates to the Imagedata type in place of the image parameter.

Supported protocols

The HYPERLINK function supports the following protocols:

  • http
  • https
  • mailto
  • ftp

If you specify an unsupported protocol, the link opens a blank page. If you don't specify a protocol, the HYPERLINK function prepends http: to the URL.

Notes

You can't change the data type of Hyperlinkfields.

To display a clickable link in a table that displays the full URL as the anchor text, you can also use the URL field type .

If you've enabled Viewer's credentials for a data source, Looker Studio won't render hyperlinks.

Examples

Use HYPERLINK to create a product catalog with pictures of the items that have been sold and links to individual product description pages.

Suppose you have a dataset with the following fields:

  • Item- The name of the product
  • SKU- The product identifier
  • Product Page- The URL of the product's description page
  • Product Image- The URL of the picture of the product that you want to display

For example:

Item SKU Product Page Product Image
Pen
123 https://example.com/products/product123.html https://example.com/images/product123.jpg
Notebook
456 https://example.com/products/product456.html https://example.com/images/product456.jpg
Coffee Cup
789 https://example.com/products/product789.html https://example.com/images/product789.jpg

Creating a data source from the previous example gives you the following fields:

Field Type
Item Text
SKU Text
Product Page URL
Product Image URL

To display links to the product description pages, create a Product Linkcalculated field with this formula:

HYPERLINK (Product Page, SKU )

The data source now looks like this:

Field Type
Item Text
SKU Text
Product Page URL
Product Image URL
Product Link Hyperlink

You can then add the Product Linkfield to a table in your report. This displays the data as clickable links.

Example 2: Build URLs using CONCAT

Building URLs with the CONCAT function is useful when only part of the link path is present in a field or when you want to override or add more information to the link.

For example, you could use CONCAT to combine a hardcoded page path with a product SKU to form a complete URL to your product description page:

HYPERLINK(CONCAT("http://example.com/productpages/product", SKU, ".html"), Item)

Example 3: Create clickable images

To add clickable images to a table, you also use the HYPERLINK function but provide a URL as the first parameter and an Imagefield, or an IMAGE function with a valid link to an image, as the second parameter. This creates an Image Linkfield.

In this example, the Product Pagedimension holds the URL, and the IMAGE function generates an Image field using a single hard-coded value:

HYPERLINK(Product Page, IMAGE("https://example.com/images/product789.jpg", "Coffee cup")

As a more realistic example, you might either create the Imagefield ahead of time and store it in your data source or use the CONCAT function to build the IMAGE parameter:

HYPERLINK(Product Page, IMAGE(CONCAT("https://example.com/images/"), SKU, ".jpg", Item))

The YouTube Analytics connector automatically provides links and thumbnail image fields you can add directly to tables in your reports:

Field Type Description
Video Link
URL The link to the video on YouTube
Thumbnail Link
URL The link to the video thumbnail image
Thumbnail
Image The thumbnail image
Linked Thumbnail
Image Link The thumbnail image formatted as a link to the video on YouTube

Create a Mobile Website
View Site in Mobile | Classic
Share by: