superset icon indicating copy to clipboard operation
superset copied to clipboard

URL link to column values

Open Narendra678 opened this issue 2 years ago • 6 comments

Hi Team,

I have one column with URL values, in superset it is not coming with underline. Please suggest.

Requirement: When click it should open with new tab.

Regards, Naren

Narendra678 avatar Mar 28 '22 07:03 Narendra678

Hi @Narendra678 it would be great to get more context before we can call this a bug! The community is missing a lot of context here to be able to help you resolve the issue or begin the investigate the bug!

  • What does your raw data look like in your database?
  • How is Superset rendering the link?

Please include screenshots / gifs / videos, feel free to anonymize the data, gray sensitive things out, etc.

First things first -- are you enriching the URL values with HTML syntax so the browser can interpret its a URL? Max has an example here: https://images.contentful.com/ykljvmtfxwdz/2VC6yWapWjsK8RzzO95r56/fa525ccf8224639d3d7a09e5d63f608b/calculated.png from this post (https://preset.io/blog/2020-04-15-github-community-dashboard/#summing-up)

srinify avatar Mar 28 '22 15:03 srinify

Hi Srinify,

Please find below screen. image

raw data is with underline, once click it routs new tab.

Regards, Naren

Narendra678 avatar Mar 28 '22 15:03 Narendra678

Hmm sorry now I'm confused -- what's the issue? Is the failure the lack of underline or is the failure the lack of opening the URL when clicked on?

srinify avatar Mar 28 '22 16:03 srinify

When clicked on that text it should route to that URL.

EG: https://www.google.com/?safe=active&ssui=on

when click on above it should go to google search.

Narendra678 avatar Apr 08 '22 08:04 Narendra678

In a regular table, you can use normal HTML formatting tags like Google and it will be rendered as a link. It appears this is not possible nor will it be supported in pivot tables: https://github.com/apache/superset/issues/16778.

I came here when the HTML link tag was not being rendered. I clicked around in Superset - looked at the edit view of my data source, changed the chart type to a pivot table and back - and for some reason it began rendering as clickable. Not sure what the issue was but can confirm that you can use hyperlinks in the regular "Table" chart in 2.0.0.

sfirke avatar Aug 19 '22 13:08 sfirke

+1

Sandy381 avatar Nov 25 '22 05:11 Sandy381

This is not a bug... URLs to not automagically convert themselves to HTML links. In your SQL query, or a calculated column you can SELECT some HTML to make it an actual like, for example SELECT CONCAT('<a href="https://www.github.com/apache/superset/pull/', pr_id, '" target="_github">', pr_id, '</a>') as link.

If this doesn't pan out, please feel free to open a Q&A Discussion here on the repo or join us in #debug-together on Slack

rusackas avatar Dec 09 '22 00:12 rusackas

yes @rusackas is right . I have write an article on this.

https://raowaqasakram.hashnode.dev/url-as-hyperlink-in-apache-superset

raowaqasakram avatar Jan 29 '23 14:01 raowaqasakram

But I have a problem exporting Excel and exported the HTML content. May I know how to solve it

PenneyHuang avatar Apr 14 '23 07:04 PenneyHuang

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

lucasprshepherd avatar Feb 06 '24 15:02 lucasprshepherd

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

Not that I'm aware of, but I'm curious the use case. It might be confusing since people often expect clickable headers to adjust the sorting. This might warrant its own discussion here on Github Discussions.

rusackas avatar Feb 06 '24 19:02 rusackas

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

Not that I'm aware of, but I'm curious the use case. It might be confusing since people often expect clickable headers to adjust the sorting. This might warrant its own discussion here on Github Discussions.

I am building master dashboard of sorts. It will have various high-level metrics at the monthly granularity (pivot table) and I / my supervisors want each metric to have a link to a more specific dashboard.

lucasprshepherd avatar Feb 06 '24 19:02 lucasprshepherd

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

Not that I'm aware of, but I'm curious the use case. It might be confusing since people often expect clickable headers to adjust the sorting. This might warrant its own discussion here on Github Discussions.

I am building master dashboard of sorts. It will have various high-level metrics at the monthly granularity (pivot table) and I / my supervisors want each metric to have a link to a more specific dashboard.

Hmm... the two easy workarounds (unless you want to talk about designing/contributing a feature) might be:

  1. Use the "Text" (formerly Markdown) dashboard component to provide an index of links/resources
  2. Just add a calculated column so that all metric cells provide a link to the same/relevant dashboard.

rusackas avatar Feb 06 '24 19:02 rusackas

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

Not that I'm aware of, but I'm curious the use case. It might be confusing since people often expect clickable headers to adjust the sorting. This might warrant its own discussion here on Github Discussions.

I am building master dashboard of sorts. It will have various high-level metrics at the monthly granularity (pivot table) and I / my supervisors want each metric to have a link to a more specific dashboard.

Hmm... the two easy workarounds (unless you want to talk about designing/contributing a feature) might be:

  1. Use the "Text" (formerly Markdown) dashboard component to provide an index of links/resources
  2. Just add a calculated column so that all metric cells provide a link to the same/relevant dashboard.

I am currently using option 1, but now that I see that option 2 IS an option, I will definitely float the idea to my team. Thank you!

lucasprshepherd avatar Feb 06 '24 19:02 lucasprshepherd

Coincidentally, I just saw this old PR that slid under everyone's radar, if you want to take a look at that: https://github.com/apache/superset/pull/22604

rusackas avatar Feb 06 '24 20:02 rusackas

Coincidentally, I just saw this old PR that slid under everyone's radar, if you want to take a look at that: #22604

That is exactly what I am looking for! Would love to see that feature be implemented.

lucasprshepherd avatar Feb 06 '24 20:02 lucasprshepherd