I extended from the API defined here, specifically the DataSourceVariableSupport class. This makes the QueryEditor component appear in the UI when adding a query variable, so users can use the output of a notebook to populate their variables:
By default, Grafana's internals uses the first string column in the resulting dataframe to populate the dataframe. So if your notebook result is
then the variable's values will be [Martha, Tim, Robert, Georgia]. I also added a new supported return type 'array' for notebooks to make setting variables more explicit. e.g.
https://ni.visualstudio.com/DevCentral/_workitems/edit/1820088
I extended from the API defined here, specifically the
DataSourceVariableSupport
class. This makes the QueryEditor component appear in the UI when adding a query variable, so users can use the output of a notebook to populate their variables:By default, Grafana's internals uses the first string column in the resulting dataframe to populate the dataframe. So if your notebook result is then the variable's values will be [Martha, Tim, Robert, Georgia]. I also added a new supported return type 'array' for notebooks to make setting variables more explicit. e.g.