Is there a way to provide an alias for links in table cells?

Hi. I’m trying to create a visualisation for a table which contains URLs. The problem is - they’re really long and it makes the column too large. Is there any way to provide an alias for these links, e.g. so https://www.my-elongated-example-website.com/foo/bar/baz/too/many/folder/names/this/will/really/bloat/up/my/table/view is rendered as “Foobar”, but when you click “Foobar” it still goes to the same URL?

I’ve tried doing a Value Mapping > Value to Text, but this seems to have two problems:

  1. When I convert the link to “Foobar”, it’s not an aliased link. It just tries to take me to an address called “Foobar”.
  2. I can only convert one link, not all of them in the column.

Is there any support for aliased links in Grafana? Or some other solution that will avoid a bloated table?

Hi @leoking1

Yes, there does not appear to be a perfect solution to your problem. You could manually map each url to a different text value in the table, and you could then add the same datalink to every cell in that column, but that’s not very helpful:

I don’t know if there is a way to dynamically transform every url to a different value inside the UI.

What is your datasource? The only potential workaround I can think of without adding a new feature would be to use the Text panel. If you could retrieve your data outside of Grafana, you could then dynamically insert it into an html table and use a tags to add your links with aliases…

Thanks for the reply Matt. I’ve figured out the solution actually.

What I needed was to use data links. In my original table I had another column which contains raw URLs. Say this column is called “Link”. I include another column in my table, which contains the values I want to alias, say it’s a column of short dates or something. In the alias column I add a data link to ${__data.fields.Link} and then links every cell in the alias column to the cell on the same row in the Link column.

It works perfectly. The only downside is that it’s not (AFAIK) possible to hide the link column using transforms or otherwise, otherwise the links in the alias column will break.

Fantastic! One thing: have you tried hiding the link column using the organize fields transformations?

scratch that. possible with the old table panel but not the new one. GIve a thumbs up to the issue and hopefully we can return to it soon:

there’s a milestone for 8.1 release. soon!

This topic was automatically closed after 365 days. New replies are no longer allowed.