Link display in Table visualization

Hi guys,

I have a self hosted instance of Redash (Version: 8.0.0+b32245) and I’m trying to setup a link in the table visualization.
This table is based on a query with rollup function, so as a result I have some empty cells in my table:

When I setup link and put the address in the visualization settings, these empty cells show this address :frowning:

Do you have any idea how I can remove these addresses from empty cells?

Thank you!

The link column type always shows something. You could change the Text Template to a less distracting value like “Click Here”. But it would still appear even when the link is “dead”.

AFAIK the only way to hide a missing link is to encode the link in your SQL:

SELECT
    CASE WHEN MerchantLocation IS NULL THEN ''
    ELSE '<a href="http://192.168.56.101:5000/dashboard/' || table.Field || '">' || MerchantLocation || '</a>' END as MerchantLocation
FROM ...

Then check Allow HTML Content on that column of the table visualization.

Thanks a lot for the clarification and suggestion!

Unfortunately HTML link doesn’t work for me as I need to open a new dashboard in a new tab, but I’ll play with Text Template.

You can do this with an HTML link! Just add target="_blank" to the tag. Updating the code example from before:

SELECT
    CASE WHEN MerchantLocation IS NULL THEN ''
    ELSE '<a target="_blank" href="http://192.168.56.101:5000/dashboard/' || table.Field || '">' || MerchantLocation || '</a>' END as MerchantLocation
FROM ...

This will open in a new tab :smiley:

Ah, thanks a lot!! I’m not good at HTML unfortunately :grimacing:

And if I need to transfer parameters to the new dashboard, is it possible too?

Sorry sorry! Just realized how to transfer parameters, thanks again for you help!