mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variables: Adds queryparam formatting option (#30858)
* Variables: Adds queryparam formatting option * Chore: fixes strict errors * Chore: changes after PR comments
This commit is contained in:
@@ -49,6 +49,6 @@ Value-specific variables are available under ``__value`` namespace:
|
||||
|
||||
When linking to another dashboard that uses template variables, select variable values for whoever clicks the link.
|
||||
|
||||
``var-myvar=${myvar}`` - where ``myvar`` is a name of the template variable that matches one in the current dashboard that you want to use.
|
||||
``${myvar:queryparams}`` - where ``myvar`` is a name of the template variable that matches one in the current dashboard that you want to use.
|
||||
|
||||
If you want to add all of the current dashboard's variables to the URL, then use ``__all_variables``.
|
||||
|
||||
@@ -149,3 +149,13 @@ servers = ["test1", "test2"]
|
||||
String to interpolate: '${servers:text}'
|
||||
Interpolation result: "test1 + test2"
|
||||
```
|
||||
|
||||
## Query parameters
|
||||
|
||||
Formats single- and multi-valued variables into their query parameter representation. Example: `var-foo=value1&var-foo=value2`
|
||||
|
||||
```bash
|
||||
servers = ["test1", "test2"]
|
||||
String to interpolate: '${servers:queryparam}'
|
||||
Interpolation result: "var-servers=test1&var-servers=test2"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user