I know this has been asked in multiple other threads before but I haven’t found a satisfactory answer yet and I can’t accept that there’s just no way to do this.
The app I’m working on has a dropdown menu that basically lets the user switch between different profiles under the same account, via a global variable. Nearly all the data displayed in the app is dependent on what profile is currently active, only data associated with the current profile should be displayed. Hence, when the profile selector is used to switch profiles, ideally all collections should be re-fetched accordingly. At the very least, all collections used on the current page.
I have tried using JS to reload the entire page, to no avail (profile selector resets to the profile that was active before the profile change).
The next suggestion I’ve seen that I’m in the process of implementing is using a workflow with branching logic to fetch specific collections based on the current page. This should work in theory but my app has 30+ pages so setting this up is incredibly tedious, not to mention the extensibility & maintainability issues. Also several collections are filtered based on other collections which means I have to think through the order things need to load in for everything to work correctly. Again, tedious and fragile. Side note: WeWeb really needs a way to leave comments in workflows, etc.
Surely there is a programmatic way to determine what collections are in use on a given page, and what the dependencies are such that they can be automatically re-fetched in the correct order. I really think this should be available as a workflow action but in the meantime I would be very grateful if someone could point me in the right direction to get this done in JS. I have tried looking through the wwLib methods in my browser devtools console but am not getting anywhere with that.
Thank you!
GD