I want to use a side pane to open a custom page in a model driven app. (see Creating side panes by using a client API in model-driven apps - Power Apps | Microsoft Learn). This custom page contains information specific to the form that I am on and it is specific to only one table/entity that I have in model driven app.
I want to be able to close the side pane automatically when the user navigates away from this table. So if he/she chooses a different menu item on the navigation pane, then the relevant side panes would close. The only thing I can think of to do is to put an onload event on every entity and view in my model driven app that dismounts the side panes that are open. I don't think this approach is going to be manageable. Or, I could use the OnSave event but it is not always certain that the user would save the form and thus trigger the closing of the page.
Is there a type of event that fires when the navigation changes or form closes? In other words, I could addEvent when I open the custom page that listens for when said form closes or is no longer available and then this event would close the side pane and remove itself.
Any ideas?

Report
All responses (
Answers (