6

Passing variables while ‘Bookmarking’ in SAC analytical application

 1 year ago
source link: https://blogs.sap.com/2023/06/09/passing-variables-while-bookmarking-in-sac-analytical-application/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
June 9, 2023 1 minute read

Passing variables while ‘Bookmarking’ in SAC analytical application

Feature discussed: Passing variables from main application to bookmark

Context / scenario:

We have several custom widgets in our application which requires initialization since bookmarking won’t load custom widget state. For loading this custom widget, we need the state of many variables in application while the application was bookmarked. For ex: selected country, selected cost center, selected month etc.

Solution:

Saving bookmark :

We can pass the variables values using an array. This array has to be passed as a parameter in saveBookmark API namely properties. Syntax

Save%20bookmark%20with%20properties

Save bookmark with properties

Even arrays can be passed by converting them to string using join function.

Syntax:

var VAR_VERSION_KEYS_txt = VAR_VERSION_KEYS.join(‘;’);

Loading bookmark:

In the initialization script, we have to get all variables passed in properties using below syntax and call appropriate functions to load custom widgets

Loading%20bookmark%20after%20reading%20passed%20properties

Loading bookmark after reading passed properties

In summary, we can pass variables using Properties of bookmark while saving and use it to load custom widgets once bookmark is loading other widgets. This is a quite feasible work around when we have requirement to bookmark applications with custom widgets without many hassles. There is limitation to pass only a specific number of characters maximum in the properties. We could pass around 60+ variables in one of the applications.

References on bookmark

SAP Analytics Cloud help for Bookmarks topic: https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/00f68c2e08b941f081002fd3691d86a7/f1a0142d6c0b4a1ab9ad22a2c516db96.html?locale=en-US

Other blogs related to bookmarks:

https://blogs.sap.com/2022/09/14/how-to-use-bookmark-in-analytic-application-sac-planning-with-javascript/

Post and Answer questions related to SAC topics: https://answers.sap.com/tags/67838200100800006884


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK