Symptom
- In SAP Analytics Cloud, array script variables of type string are filled via script.
- After creating a bookmark and reopening it, the script variables are found to be empty.
- The expected behavior is that the script variables should retain the value when the bookmark was created.
Environment
SAP Analytics Cloud
Reproducing the Issue
- Open a story in SAP Analytics Cloud.
- Use array operation e.g. push() to pass the array.
- Bookmark the current state.
- Open the bookmark.
- The array variable was missing (turns empty in console log).
Cause
Script variables can not be bookmarked for some array operation like "push()", its value can only be bookmarked via using assignment expression ("=").
Also you cannot bookmark changes you make to the non-primitive type script variables (types other than string, boolean, integer, and number).
Resolution
As a workaround, please consider to use array operations like slice() to clone the source array first and use "=" to assign to the target array.
Or you may consider to assign the widget's name(string, like "Chart_1") to the array, and later use "Application.getWidgets" to retrieve this widget instance by using name. For example as below:
ScriptVariable_1 = "Chart_1";
var chart = Application.getWidgets({searchPattern: ScriptVariable_1, type: WidgetType.Chart})[0];
chart.setVisible(false);
See Also
- 2569847 - Where can you find SAC user assistance (help) to use, configure, and operate it more effectively?
- Have a question? Ask it here and let our amazing SAP community help! Or reply and share your knowledge!
- 2487011 - What information do I need to provide when opening a case for SAP Analytics Cloud?
- Search for SAP Analytics Cloud content using Google or Bing:
- https://www.google.ca/search?q=site%3Ahttps%3A%2F%2Fapps.support.sap.com+SAP+Analytics+Cloud
- https://www.bing.com/search?q=site%3Ahttps%3A%2F%2Fapps.support.sap.com+SAP+Analytics+Cloud
- Note: Add relevant text or warning/error messages to the text search field to filter results.
- SAP Analytics Cloud > Learning > Data Connections
- SAP Analytics Cloud > Learning > Guided Playlists
- SAP Analytics Cloud > Learning > Guided Playlists > Getting Support
- Need More Help? Contact Support or visit the solution finder today!
Your feedback is important to help us improve our knowledge base.
Keywords
SAP Analytics Cloud, array script variables, bookmark, empty variables, data analysis, visualization, scripts, console log, missing variable, bookmark state. , KBA , LOD-ANA-AD-INF , Analytics Designer Infrastructure , LOD-ANA-UNS-SCR , Unified Story Scripting related Issues , Problem