Scenes Plugin cannot update CustomVariable but Grafana Dashboard can update the variable

Trying to create a Scenes App which can either update a CustomVariable to reflect changes in the system or add a new variable to the SceneVariableSet.

When creating a Grafana Dashboard, the CustomVariable can be created, then updated. When navigating back to the Dashboard the drop-down contains the updated values.

This does not work in the Scenes plugin using an EmbeddedScene.

Can anyone help to explain how this can be performed in a Scenes plugin.

I created a repo, GitHub - McDurby/durby-durbysceneabc-app: Grafana Scenes Plugin to demonstrate dynamic updating of the Scene, which contains two examples, only the first one is complete, ABCScenes.tsx.

The README contains screen shots of:

  • a Grafana Dashboard
  • For the Scenes, the DevTools console and the drop-down on the plugin

I’m looking forward to understanding the possible options.

you need to call validateAndUpdate on the variable for it to re-evaluate it’s options & current value. This function returns an observable (as variable eval can be async) so you need to subscribe to it for it to actually perform the update.

Torkel,

Thanks, I’ll look into the API to understand the exact steps.

I appreciate your time.