Message pop up when closing/leaving dashboard page
- 2 years ago
The only action that can be triggered by closing a page, which I'm aware of, is the SQL Table Editor "there is unsaved data, are you sure you want to continue" pop-up. So a possible workaround (totally untested, rough, etc etc) might be to have users somehow interact with a minimal sqlTE, to "dirty" the state, so that on close you can then react to the save-state event. However, it feels difficult, hacky, and ugly, so I'm not keen on recommending it.
A simpler way could be to have a DataManagement job that runs periodically and resets the state. Keep an extra table that records when the state was last altered, and if it's over, say, 2h, switch everything back. DM jobs can also be triggered via REST Api as well, so if you have a chance to trigger an http endpoint when the call ends, you could leverage it that way instead. If you can't configure the REST Api (it requires third-party SSO integration), you can still launch them from Powershell or the Desktop Client Api.
In OneStream, this type of cleanup typically is performed as part of Workflow events. So if your Dashboard is in a Workspace step, you can play around with those states too.