How to set a dashboard variable

 toVariablePayload(
    {
      type: 'custom',
      id: 'aaa'
    },
    ???  <---  I'M STRUGGLING WITH THE TYPE HERE - HELP PLEASE
  )
));

I have a dashboard variable named aaa, I want to set it to (lets say) 4.

Iā€™m not sure what toVariablePayload does, but if you want to set a dashboard variable programmatically, you can read how on how to Set a variable from your plugin.

2 Likes

yes, eventually I realised that toVariablePayload is not the way,
I used getLocationSrv() and it works.
Thanks

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.