diff --git a/public/app/features/variables/state/actions.ts b/public/app/features/variables/state/actions.ts index 45c88555a2a..392da119971 100644 --- a/public/app/features/variables/state/actions.ts +++ b/public/app/features/variables/state/actions.ts @@ -47,6 +47,7 @@ import { hasLegacyVariableSupport, hasOptions, hasStandardVariableSupport, + isAdHoc, isMulti, isQuery, } from '../guard'; @@ -517,7 +518,9 @@ export const variableUpdated = ( const variables = getVariables(state); const g = createGraph(variables); const panels = state.dashboard?.getModel()?.panels ?? []; - const affectedPanelIds = getAllAffectedPanelIdsForVariableChange(variableInState.id, variables, panels); + const affectedPanelIds = isAdHoc(variableInState) + ? undefined // for adhoc variables we don't know which panels that will be impacted + : getAllAffectedPanelIdsForVariableChange(variableInState.id, variables, panels); const node = g.getNode(variableInState.name); let promises: Array> = [];