Best practices to keep info

  • Goal: I have multiple pages in the app; and switching between them reset the widgets inside of them. I want multiselect to keep the selected items, for example.

  • Steps: One of the ways to achieve that I could think of is to use URL parameters. But somehow, 'Default value' in multiselect filled with URL parameters doesn't work the way I expected it to (does nothing).

What could be the solution of that problem if I don't want to move multiselect into the global scope?

Hi @pavelgur,

How are users switching between app pages?

Let me do some testing and see if this is a multiselect specific bug.

Are you able to move variables between pages but the multiselect isn't able to populate the selected values on page load?

Just about any user event such as a button click with the Action set to "Go to Page" should allow for configuration of query params, hash params or other variables that you can pass between pages of an app. As shown in the bottom image of our docs here. Which should be able to pass directly into the multiselect to have these become selected once they render. Maybe there are race conditions and the multiselect still needs to load to the page before the selection can be applied :thinking:

Unfortunately the trade off of multipage apps being optimized for the current page is that the state of other pages is not maintained. There are some customizations such as for tables to maintain a selected row or have a default selection on page load.

Hopefully the docs can help with the URL parameters as that is odd that you are reporting that they are not doing anything. I would need to see some screen shots to better help troubleshoot as to how it could be changes to follow the example in the docs to work as expected.

Hi @pavelgur,

Just wanted to circle back and see if any of my suggestions were helpful!

Some components can be set on page load and query scripts can run on page load, combining that functionality with url params and hash params as well as database storage is likely the best combo currently for holding stateful data in the frontend of an application.