Hi,
We use a grid component in dashboards to use basic HTML to create a hyperlink(we understand this is a soft-launch feature.) We connected the hyperlink to a GQI query that returns a URL link to another dashboard by using the name of the return parameter between curly braces which works fine. The issue we are having is the link returned by the GQI query contains curly braces to filter the dashboard for a specific entry which causes the hyperlink not to work in its entirety, it takes us to the dashboard but does not filter for the specific entry. Is there a way to escape the curly braces?
Hello
Great to hear you are experimenting with the Grid visualization. It is a very powerful tool to take your dashboards and low-code apps to the next level. You have to take some things in mind though. When you are using a value directly in the text shape as href attribute of an anchor tag, you should make sure everything is properly url encoded, otherwise you could end up with the issue you're currently facing. To resolve this you could replace { by %7B and } by %7D, where you generate the url values that are fetched by GQI.
However, we could also embrace the power of GQI, by leveraging the custom operator. Then your data source can remain untouched, and it will just encode that one column that contains the link values, while querying the data.
I took the liberty to create an example of such a custom operator that should do the trick. Note that this operator will encode the entire column, so it should only contain the dynamic part of the url (not including the https://...).
What it will do
- From a query that results in a table with eg the column FilterValue...
FilterValuevalue {1}
value {2} - ...it will, after applying the custom operator, result in...
FilterValuevalue%20%7B1%7D
value%20%7B2%7D
- ...which we could then use in the text shape of our Grid visualization:
<a href="https://myagent/dashboard/#/db/myDashboard.dmadb?filter={FilterValue}" target="_blank">filter</a>
Note: As an alternative, if it isn't a requirement to use dashboards, you could create the grid in a low-code app and trigger an action on click instead of using html in a text shape. That action will already properly encode the url for you when opening the url.
Thank you!! This helped so much