Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL link to column values #19391

Closed
Narendra678 opened this issue Mar 28, 2022 · 16 comments
Closed

URL link to column values #19391

Narendra678 opened this issue Mar 28, 2022 · 16 comments
Labels
#bug Bug report question & help wanted Use Github discussions instead

Comments

@Narendra678
Copy link

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 Narendra678 added the #bug Bug report label Mar 28, 2022
@srinify
Copy link
Contributor

srinify commented Mar 28, 2022

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 srinify added the question & help wanted Use Github discussions instead label Mar 28, 2022
@Narendra678
Copy link
Author

Hi Srinify,

Please find below screen.
image

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

Regards,
Naren

@srinify
Copy link
Contributor

srinify commented Mar 28, 2022

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?

@Narendra678
Copy link
Author

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.

@sfirke
Copy link
Contributor

sfirke commented Aug 19, 2022

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: #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.

@Sandy381
Copy link

+1

@rusackas
Copy link
Member

rusackas commented Dec 9, 2022

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 rusackas closed this as completed Dec 9, 2022
@raowaqasakram
Copy link

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

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

@PenneyHuang
Copy link

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

@lucasprshepherd
Copy link

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

@rusackas
Copy link
Member

rusackas commented Feb 6, 2024

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.

@lucasprshepherd
Copy link

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.

@rusackas
Copy link
Member

rusackas commented Feb 6, 2024

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.

@lucasprshepherd
Copy link

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!

@rusackas
Copy link
Member

rusackas commented Feb 6, 2024

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

@lucasprshepherd
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report question & help wanted Use Github discussions instead
Projects
None yet
Development

No branches or pull requests

8 participants