Skip to Content
Technical Articles
Author's profile photo Rohit Chouhan

How to use Bookmark in Analytic Application SAC Planning with JavaScript

If you’re an application designer, you can create a bookmark set technical object so application users can save the state of your analytical app at runtime.

image source:

In order to dynamically create bookmarks in the analytics application, please follow the steps below.

Before staring, create Bookmark set from scripting.

  1. First create one popup with components inside.
Component Component Name
InputField InputField_1
RadioButton RadioButtonGroup_1
Dropdown Dropdown_1
Button Button_1, Button_2, Button_3



Radio Button Group Value:

id Value
false Personal
True Global

2. Create ScriptObject with two script function, with name myBookmark

  • getBookmarkCreate one Arguments, with return type void.
Argument Name Type
type string

Add this below code in getBookmark()

var bookmarks = BookmarkSet_1.getAll(); 

var globalType = false;
	globalType = true;

for (var i =0 ; i<bookmarks.length;i++){
	if(bookmarks[i].isGlobal === globalType){

  • setBookmarkCreate two Arguments, with return type void.
Argument Name Type
name string
type string

Add this below code in setBookmark()

var globalType = false;
	globalType = true;

BookmarkSet_1.saveBookmark({name: name, isGlobal: globalType});
Application.showMessage(ApplicationMessageType.Success,InputField_1.getValue()+" Bookmark Saved");

3. Add this all code inside all components mentioned below

  • RadioButtonGroup_1
  • Button_1
  • Button_2
  • Button_3
Application.showMessage(ApplicationMessageType.Success,Dropdown_1.getSelectedText()+" Bookmark Deleted");

4. Create new Button in Canvas, and open popup with this code;



In the case of multiple components or filters, we have to save our application states multiple times, so bookmarking is the best way to save multiple states quickly.

Assigned Tags

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

      Hello Rohit Chouhan


      Good blog!

      Just as an additional comment - as we see a lot of issues with this.

      A user will need the permission to create a bookmark, even a private one. Without this, the saveBookmark() API will fail with an unclear error message


      Author's profile photo Rohit Chouhan
      Rohit Chouhan
      Blog Post Author

      Thanks marc, it would helpful for developer.

      Author's profile photo Kevin Maurer
      Kevin Maurer

      Thanks Rohit for this tutorial. I tried to implement it in a standard Application (not planning) which was very easy following your guide, however, it does not seem to be saving / applying the filters.

      I can close and re-open the application - the bookmarks are loaded again (although it takes too long for my liking until dropdown is populated). Unfortunately, once I apply a bookmark it just reloads the application but the filter settings are not applied.

      Do you have any hints / tips? Is this approach only possible for planning?

      Thanks for your help!

      Author's profile photo James Barlow
      James Barlow

      Bookmarking with filters does get a bit more tricky,

      If you have more details I might be able to help.

      I created an analytic app for a customer that used dropdowns to filter the dashboard, the challenge was to ensure that the selected value in the dropdown - was

      1. captured during bookmarking
      2. the bookmarked dropdown value then needed to be stored in a variable
      3. then the filter re-applied when the bookmark was opened.




      Author's profile photo Kevin Maurer
      Kevin Maurer

      Hi James

      Thanks for your answer - somehow I did not get notified of your response and only just saw it in 'SAP for Me' as notification.

      Am I understanding you correctly in that you'd have to fill dropdowns manually in order to save their states as a bookmark?

      I was hoping there would be a solution to save input control states - which would seem to be the go-to solution?

      In case there's only the dropdown approach that would be too much of a workaround for what it would offer. In that case and given Story 2.0 is "around the corner" I'd probably go for a Story where this works out of the box.

      Thanks for your help though!