How well does the SAC Story Code Generator write scripts?
The Story Code Generator is designed for users who want to enhance their SAC stories with custom functionality and interactions through scripting. Instead of writing JavaScript code entirely from scratch, users can describe the desired functionality in natural language and let AI generate the corresponding code. This low-code approach aims to make the development of interactive dashboards faster and more flexible.

We spent quite a bit of time putting the Story Code Generator through its paces. After all, the real test of an AI assistant begins when you move beyond simple demo scenarios and start working with more demanding requirements. And the results genuinely surprised us. Basic tasks like "Hide the chart when the button is clicked" worked as expected, but the generator also handled much more sophisticated scripts involving nested conditions, variables and mappings between numerical values and text labels.
We had anticipated fragmented code that would need considerable manual adjustments. Instead, the AI consistently produced well-structured scripts that were ready to run in most cases. This was a noticeable improvement over our experience with AI-generated data actions, where we encountered basic syntax errors. Another welcome detail was the automatically generated code comments, which make the scripts easier to understand and maintain over time. There is one downside, however: Even moderately complex tasks took a surprisingly long time to generate.

On the positive side, the Story Code Generator can even make use of globally defined variables, as long as they are explicitly referenced in the prompt. However, things become more challenging when it comes to understanding the underlying data model. AI cannot reliably identify custom dimension structures, technical member IDs, or the logic behind them on its own. To get the desired results, you need to provide these details as clearly and precisely as possible. The same goes for widgets. If your story contains multiple dropdowns or charts, you need to tell the AI exactly which one the script should target.

Another limitation concerns the modification of generated code. Unlike traditional AI chat assistants, the Story Code Generator does not offer an ongoing dialogue in which a script can be refined step by step. Instead, each request generates a new script that can only be accepted or rejected in its entirety. If the result does not meet expectations, a new prompt must be formulated.
We also identified room for improvement when modifying existing scripts. During our tests, the AI did not always remove the previous code completely, making manual adjustments necessary.

The key takeaway: The Story Code Generator can make scripting in SAP Analytics Cloud considerably easier, delivering impressive results even for more demanding tasks. But getting the most out of it comes down to writing effective prompts. The clearer and more detailed your instructions are, especially when it comes to variables, widgets, and data structures, the more reliable the results will be.
SAP Analytics Cloud Base AI Features: Our Conclusion
With Prompt Insights and the Story Code Generator, SAP is taking another step toward bringing AI into everyday workflows in SAP Analytics Cloud. What we particularly appreciate is the greater flexibility these features offer. Prompt Insights gives story designers control over the questions being asked and how the AI presents its findings. Together with data masking, it offers a more secure and convenient alternative to exporting business data into external AI tools.
The Story Code Generator was the standout feature in our hands-on tests. We were particularly impressed by how reliably it handled more complex scripts. While we encountered basic syntax errors when testing AI-generated data actions, the Story Code Generator consistently produced working code.
Of course, there is still room for improvement. Code generation can take quite some time, the AI does not always recognize custom data structures, and refining existing scripts is not as straightforward as we would like. One major limitation is the lack of contextual understanding. The AI often lacks information about the underlying data models and custom data structures, and unlike other AI agents, there is currently no way to provide this context explicitly.
Even so, our verdict is overwhelmingly positive. For a feature included in SAP Analytics Cloud without additional licensing costs, the Story Code Generator offers remarkable value. It already has the potential to save time, simplify development, and make custom scripting more accessible to business users. With a few improvements, it could become an even more powerful tool for building interactive, customized SAC stories.
Ready to explore what these new AI features could bring to your organization? Our SAP Analytics Cloud experts can help you identify the right use cases, evaluate the capabilities, and integrate them into your existing analytics and planning environment. Get in touch with us to discuss your next steps.
/Logo%202023%20final%20dunkelgrau.png?width=221&height=97&name=Logo%202023%20final%20dunkelgrau.png)





