Grafana version - 10.0.1
I have a Grafana table and need to make the links imported from a local MySQL DB replaced with placeholders. Once I replace the links with a placeholder like “Click to go to the link” I still need to be able to go to that link.
Hi there,
I’d been scratching my head over this problem since the last 3 days and finally found out the solution.
Note: I’m using Grafana 11
There’s a Global variable by the name of __data.fields[“NameOfField”] as per (Configure data links | Grafana documentation)
What you can do is Create 2 columns in the Table Panel, for example, Link (the main column where the redirect will be done and the placeholder will be added) and Link-Holder.
Now, under your panel’s query, add the URL in Link-Holder column and “Click to go to the link” in Link column.
Once the above is done, go to Override and select the Link field and under the URL section add:
${__data.fields[Link-Holder]} and save.
After this, we’ll have to do something about the Link-holder field that’s currently being shown in the Table. Go to the override again and “Fields with Name” > “Link-Holder” > “Add override property” > “Hide in Table”.
This will create a placeholder in the Link column, however the “Click to go to the link” will redirect to the URL you configured in the “Link-Holder” column.
To summarize:
- Create 2 more columns; one to store the placeholder, one to store the actual URL
- Add ${__data.fields[Link-Holder]} in Link column’s data links
- Hide the Link-Holder column using override
Hope it helps.