Masking a dimension that contains a link

Good day dear community, I'm working with Looker (not studio), and I have a dataset that has a dimension that contains links. Whenever I add the dimension to a table it shows the whole link in the field (as expected) but is there any way that I can mask it to show the word "link" and work as a link when clicked? similar to what we have in Looker Studio with the function HYPERLINK

Solved Solved
0 2 334
1 ACCEPTED SOLUTION

Hey @cesarAlasDev ! 

Hope you've already found the solution. If not here is the way:
Let's say that you have this dimension that contains the links as string dimension. You can add the html parameter that makes reference to the values in the dimension and include the parameter button to convert it as a button. Additionally you can add any description from other dimensions to describe the link dynamically adding {{other_dimnension_name._value}} before the closure of the button.

 

  dimension: dim_google_url {
    type: string
    sql: "https://google.com" ;;
    html: <a href="{{value}}"><button>Link to Google</button></a>;;
  }

 

This will be the result in the explore:

dsimeonova_0-1706011428537.png

Hope it's useful! 

View solution in original post

2 REPLIES 2

Hey @cesarAlasDev ! 

Hope you've already found the solution. If not here is the way:
Let's say that you have this dimension that contains the links as string dimension. You can add the html parameter that makes reference to the values in the dimension and include the parameter button to convert it as a button. Additionally you can add any description from other dimensions to describe the link dynamically adding {{other_dimnension_name._value}} before the closure of the button.

 

  dimension: dim_google_url {
    type: string
    sql: "https://google.com" ;;
    html: <a href="{{value}}"><button>Link to Google</button></a>;;
  }

 

This will be the result in the explore:

dsimeonova_0-1706011428537.png

Hope it's useful! 

Thanks a lot!