Knowledge Drop

Can I conditionally display a `link`?

  • 8 July 2021
  • 0 replies
  • 354 views

Userlevel 5

Last tested: May 11, 2020
 

Yes, but only using liquid conditional logic (meaning we cannot show a link in one dashboard but not another, unless they are in a separate model, explore, etc. - there's a feature request here to +1).

A link defined with the link parameter will only display if a URL is associated with the link. We can use liquid to conditionally input a URL, or leave it blank but not putting an else statement.

Over-simplified example:

 

dimension: foo {

link: {

label: "Link Label"

url:

"

{% if _explore._name == 'bar' %}

/dashboards/1234

{% endif %}

"

}

}

 

This will show the link in one explore, but not others:

Explore_Users_and_Explore_Order_Items.png

 

This content is subject to limited support.                

 

 


0 replies

Be the first to reply!

Reply