grafana / scenes

Build Grafana dashboards directly in your Grafana app plugins.
https://grafana.com/developers/scenes
Apache License 2.0
133 stars 20 forks source link

MSSQL Chained Variables are not interpolated #863

Closed NaelDj closed 1 month ago

NaelDj commented 1 month ago

Hello!

I found this issue (https://github.com/grafana/scenes/issues/283) but I have the same problem but with MSSSQL. I already updated Grafana to 11.1.0 and Scenes to 5.7.3

This is my setup:

export const getScene = () => {
  const projectNo = new QueryVariable({
    name: 'ProjectNo',
    datasource: mydatasource,
    query: 'SELECT distinct ProjectNo FROM projects'
  });

  const WPS = new QueryVariable({
    name: 'WPS',
    datasource: mydatasource,
    query: `SELECT distinct Procedure FROM Procedures WHERE projectno = '$ProjectNo'`
  }); 

  return new EmbeddedScene({
    $variables: new SceneVariableSet({
      variables: [projectNo, WPS],
    }),
    controls: [
      new VariableValueSelectors({}), 
    ],
    body: new SceneFlexLayout({
      children: getMyTextPanel()
    }),
  });
}

I get this error when the scene is loaded:

image

This is also my stack trace:

image

When there is no chained variable everything works. Working together with: @LarsStegman

Thank you in advance!

torkelo commented 1 month ago

I think you need to use latest Grafana or latest Scenes v5.7.4

NaelDj commented 1 month ago

Yes updated to Grafana 11.1.2 worked, thank you!