Skip to Content
Author's profile photo Karol Kalisz

How to restore custom filters after bookmark load

The Situation

when you load a bookmark, your filters get modified. This is caused by the way how filters interact with variables and multiple data sources (last variable values wins after bookmark load). Example for this scenario – Bookmarks not work when more than one filter panel is used in an application

The Proposal

if you face such scenario, you can do following:

  • save your filter per data source somewhere – eg. hidden text component
  • save the bookmark

and on load:

  • load the bookmark (which also contains the hidden component with the filter values
  • apply the filter values explicitelly after the bookmark is loaded

Script for Save

// assure your filters are acutal
// save bookmark
var bookmark = Bookmark.saveBookmark();
// add on drop down
DROPDOWN_1.addItem(bookmark, DS_1.getFilterExt("0BC_PERS1"));

Script for Load

// load selected bookmark
var bookmarkId = DROPDOWN_1.getSelectedValue();
// now, apply the saved filter from the hidden text
DS_1.setFilterExt("0BC_PERS1", TEXT_FILTER.getText());

General Information

you can use also such hidden fields to store yourselt any other information in the bookmark, as bookmark is saving everything what is in the application. More in Insides on Bookmarking blog.

Example App

An Application with example can be downloaded at the BIAPP Repository (name: SCN_STORE_RESTSTORE_FILTERS) :

I hope this helps.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Karol,

      I see the complexity in handling this correctly.

      Before each bookmark is saved, it has to first check the current filter values of all 10 dimensions in each data source and save the information as a constant array of arrays. e.g.

              bookmark1, DS1dim1filterarray, DS1dim2filterarray….., DS2dim10filterarray

              bookmark2, DS1dim1filterarray, DS1dim2filterarray….., DS2dim10filterarray



              bookmarkXXXX, DS1dim1filterarray, DS1dim2filterarray....,DS2dim10filterarray

      Then at the time of loading, first, get the name of the bookmark and then get all the filter values information and set them according to the stored information.

      Since we do not know how many bookmarks a user will create, we do not know how many of such hidden containers have to be made in advance.

      Would you please help me to understand how this can be handled.

      Thank you in advance.

      Best regards,


      Author's profile photo Karol Kalisz
      Karol Kalisz
      Blog Post Author

      Hi Zabrina,

      sure, not the easiest way - I understood in your scenario, that you need it for only one dimension and 2 data sources (means 2 hidden text fields). Of course, if you want to make it for more - in 1.3 release - you need more elements.

      jsut try it out for your scenario - and then you can evaluate if this is feasible.

      btw. instead of hidden text fields, you can use global script variables.


      Author's profile photo Former Member
      Former Member

      Hi Karol,

      Actually in my scenario, I need all 10 dimensions and 2 data sources since in reality end users can choose to change up to 10 dimensions. I think that the reloading part is still OK and one can use 20 hidden dropdown boxes. One additional item will be added whenever one extra bookmark is created.

      However, what about sharing bookmark? The generated one is incorrect and cannot be shared since it needs to be adjusted. Can I conclude that this workaround solution cannot be shared?

      Thank you for your feedback.

      Best regards,