Hi everyone,
I am developing a custom Grafana plugin for working with a structure of similar elements. The idea of the plugin is to display a list of elements and allow switching between them, while all other visualizations on the dashboard automatically adjust to the selected element. This approach allows using a single universal dashboard instead of creating many separate dashboards.
During implementation, I encountered an issue with passing a dashboard variable. When I pass the element path together with the element attributes in the variable value, the visualizations that use this variable do not display any data. However, if I manually set the same variable value, everything works correctly.
An important detail: previously, I was passing only the element path in the dashboard variable, and the attributes were added directly inside the visualizations. In that case, everything worked as expected. The issue appeared only after I started passing the attributes together with the element path as part of the variable value.
Could you please advise what might be causing this behavior and how it can be fixed?
Below I’ve included all relevant settings for better context.
As a datasource I use Pi osisoft.
Dashboard variable settings:
Connecting a variable to a visualization
const setQuery = (value: string) => {
const paths = findPathToValue(tree, value) as string[];
const node = findNodeByPath(menuBuilder, paths);
const attributes = getSelectedAttributes(node);
setActiveItem(value);
const elementPath = `${af_db_name}\\${paths.join('\\')}`;
const attrs = (attributes || []).filter((a) => !!a && a.trim().length > 0);
const fullValue = attrs.length ? `${elementPath};${attrs.join(';')}` : elementPath;
locationService.partial(
{
[`var-${vars_name}`]: fullValue,
},
true
);
};
This is the structure I am passing on for change: element1\element2;attribute1;attribute2
I would be grateful for your help!


