Element by index in variable for panel links

Hello,
i would like to create links in dashboard panel with titles from each element stored system variable

custom variable “test” contains values A,B,C,D
and i would like to extract each element by index of their position something like:
{$test[0]} will have result: A
{$test[1]} will have result: B
etc

Thank you for any sugestions

Hi @jiripostulka

this question might be easier for another member to answer if you included more details. What datasource are you using, what does your query look like, and how are you setting your variable? Can you mock up this problem for others to try and solve using dummy data? I think more details here would help.

That said, I feel like you could drop template variables into queries that reference index positions using the JSON API datasource (assuming the data you are trying to parse is JSON…)

In this case datasource isn’t importent. but i will give you exact example

this is my variable


and my goal is in SQL query find out every records in table where column “test” had values ‘A’ or ‘B’ or ‘C’ or ‘D’
how can i get all selectable values in variable to query?

because this query return only test where is ‘A’
SELECT *
FROM mydb
WHERE mydb.test IN(’${test}’);

I thing you will need to use a quer-type variable if toggling Include All option does not get you unblocked