diff --git a/public/app/features/query/components/QueryEditorRow.tsx b/public/app/features/query/components/QueryEditorRow.tsx index 9465fd5b4e4..37ce76f2dd4 100644 --- a/public/app/features/query/components/QueryEditorRow.tsx +++ b/public/app/features/query/components/QueryEditorRow.tsx @@ -88,12 +88,13 @@ export class QueryEditorRow extends PureComponent { } async loadDatasource() { - const { query, panel } = this.props; + const { query, panel, dataSourceValue } = this.props; const dataSourceSrv = getDatasourceSrv(); let datasource; try { - datasource = await dataSourceSrv.get(query.datasource || panel.datasource); + const datasourceName = dataSourceValue || query.datasource || panel.datasource; + datasource = await dataSourceSrv.get(datasourceName); } catch (error) { datasource = await dataSourceSrv.get(); }