@yosiasz Thanks! Is it still possible to access the labels within queries?
e.g.
In title: ${variableName} gives me the label, e.g., 2
Using the exact same syntax in the queries gives a different result: the values. e.g., ‘Precision’
My queries need to use 1, 2, 3, 4, 5. It would be impossible to swap the values and labels, since ‘Speed’ for example would need to map to 3 different values.
Edit: I’ve tried ${variableName:label} and ${variableName:value} in the queries. Always produces the value.
@yosiasz I’ve read that multiple times since @sowdenraymond 's response above. It doesn’t provide a single example where the variable is a key-value pair, so it’s not very helpful (that’s also why it didn’t occur to me to try the “text” option - it’s not at all clear that the “text” representation is just the label).
@sowdenraymond Yes!! Thank you for answering my question. It seemed to not be working in my case because of the way the variables were repeating on my dashboard (It was only repeating for keys which had the same values).
Btw: I believed you, until it didn’t work. Your first message:
does not work (also didn’t say anything about the spacing - thanks @yosiasz ).
And the documentation (which I went straight to after seeing that first message) is not sufficient to answer this question. It makes no mention of ‘value’ as a format, and the information for ‘text’ makes no reference to how it behaves when using key : value variables like this.
I’m interested to know how you even knew this was possible. Thank you! @sowdenraymond
My update would have been something like the following, made to …/docs/…/variable-syntax/index.md
Text
Formats single- and multi-valued variables into their text representation. For a single variable it will just return the text representation. For multi-valued variables it will return the text representation combined with +. For key-value variables (i.e. ‘test1 : 3’) it will return the key.
It should be possible to have the key determined by the value of another variable. The current solution is limited to one key-value mapping if someone is repeating rows/panels over the variable (i.e. me lol, at least I only need one mapping right now )
If I have time later I will open a feature request (maybe it exists already…?)
Also @yosiasz I submitted the pull request for the documentation.
That is working. If I need more than one mapping (example below), it will not work because my whole dashboard repeats over the variable (which is limited to just one key-value mapping).
A solution is to reference keys based another variable (like is normally possible in programming e.g. dict[var], or list[var]).
Here’s an example of what I mean should be possible:
Panels/rows repeat over the following variable:
Name: Level
Values: 1, 2, 3, 4, 5
Variables which depend on Level (used within repeating elements):