Dynamically edit all dashboards

Hi there,

I was wondering if there’s a way to dynamically update all (or a set) of dashboards. For example, say I’ve created a dashboard for a customer, and as I add customers I clone the original but edit the data as needed. Repeat as necessary. When I decide I want to add a new block I’d have to manually go through and update each of those dashboards. Instead, is there a way via Losant where I could add a block to a “base” dashboard that then gets applied to any others that I want to target?

Thank you – and please let me know if this doesn’t make sense.

Hi @Nick_Calibey and welcome to the Losant Forums!

We do not have a way of propagating a single change in one dashboard to an entire group of dashboards in our UI, but you could potentially write a script that does that using the Losant API and the Dashboard: Patch endpoint.

Your initial question about how you “clone the original but edit the data as needed” has me wondering if you are familiar with dashboard context, which allows you to reuse the same dashboard layout for multiple customers and device views through the use of variables in block configuration. If not, I recommend looking more into this feature as this sounds like it may be what you are ultimately after.

Let us know if you have any questions, and once again, welcome to Losant!

Hi Dylan,

Yeah, I’m aware of dashboard contexts – that was me being unclear. You answered my fundamental question with your first comment, though. I figured I’d be able to use a PATCH if I had to, but wrangling JSON just makes me worried as it’s error-prone. Either way, thank you for answering!

You could instead try exporting the application to get the dashboard files in a YAML format. You could then make the changes to the other dashboards, ideally with find/replace in a text editor, and re-import the bundle with the “Overwrite” conflict behavior.