I have a dashboard perfectly set up with several widgets and map actions, etc.
I now need a new dashboard that I wish to look exactly like the current one, but everything needs to be pointed to a new layer. The two layers have a very similar schema, but not exactly the same, even a few new columns/fields. However, the columns/fields are identically named between the two layers that all the map actions and widgets are pointing to.
My question is, is it possible to somehow take my existing dashboard and just change where all the widgets are currently looking at and point them all to the layer? I have already created a new webmap with only the new data layer in it.
Basically, I am asking if I can have a dashboard template and just switch everything to a new layer all at once, instead of manually adjusting each widget, etc, in the dashboard?
Yes! Check out the ArcGIS Assistant, as it can make this possible. The addition of the Map makes this a bit more complicated, but still doable.
Open your dashboard and then choose "save as" to create your new copy.
Go into the ArcGIS Assistant and open up the copy dashboard's JSON for editing. Look for the mapwidget item that refers to your map. You should be able to change the itemID being referenced.
Then go through the JSON looking for dataset arrays.
This is where you'll update the itemId of the layer datasources and their IDs.
It will likely take some trial and error, but if you know which layers are being replaced and have their itemIDs at hand, you can get your layers swapped out without needing to reconfigure all your widgets.
There was a similar question regarding Experience Builder in another thread, and an ESRI rep said an upcoming release of the Python API would allow automating that. I don't know if it applies equally to Dashboards, but they're both based on the same JSAPI now.