Data Professionals Blog posts
cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Analytics Cloud now includes AI-assisted story code generation, delivered with QRC3/2026 that enables story creators to generate scripting code for optimized story experiences with the help of generative AI, reducing the manual effort traditionally required for custom scripted interactions.

What is AI-Assisted Story Code Generation?

SAP Analytics Cloud, AI-assisted story code generation is delivered with QRC3/2026 release. It refers to a generative AI feature that helps story creators produce scripting code within the Optimized Story Experience, significantly reducing the technical barrier to creating sophisticated, interactive analytics stories.

The capability operates within the story design canvas, providing code assistance in the scripting editor. At a high level, the workflow follows a pattern similar to other generative AI coding tools, but tuned specifically for SAP Analytics Cloud's scripting API.

Traditionally, building custom story behaviour in SAP Analytics Cloud required familiarity with its scripting language: event handlers, widget properties, and data-binding logic. With AI-assisted code generation, story creators can describe their intent in plain language, and the system generates the corresponding script, making advanced story development more accessible to a broader audience.

AI-assisted story code generation lowers the barrier to creating interactive, data-driven stories in SAP Analytics Cloud,  enabling domain experts to participate directly in story scripting without deep programming knowledge.

AI-Assisted Story Code Generation

How AI-Assisted Story Code Generation Works

The capability operates within the story design canvas, surfacing AI assistance directly in the script editor. The workflow is intentionally lightweight - designed to feel like a natural extension of story development. Under the hood, a dedicated AI skill orchestrates the LLM call, applies SAC-specific context, and validates the generated script before it is presented - so what story creators see is code that already works:

  1. Open the Script Editor

    Navigate to the script editor for a widget or page event within an SAC story in the Optimized Story Experience or Analytics Designer environment.

  2. Describe Your Intent

    In natural language, describe the behaviour you want to implement.  E.g "filter the chart to show only the selected region when the drop down box is selected."

  3. AI Generates JavaScript and Explains It

    In the background, a dedicated AI skill orchestrates the call to the large language model. This skill carries full, structured knowledge of SAC's scripting API, its objects, methods, event model, and Optimized Story Experience conventions , so the LLM produces JavaScript that is specifically optimized for SAC stories, not generic code requiring manual adaptation. The result is returned alongside a contextual explanation of the logic applied, so story creators understand every script block presented to them.
  4. Automated Validation, Error-Free Before You See It

    Before the script reaches the users, the system automatically validates the generated code to confirm it is syntactically correct and can be executed within SAC without errors. This validation is built into the skill pipeline: if the initial output does not pass, the skill re-prompts the LLM and refines the script , ensuring that what appears in your editor is already runnable, not a starting point that needs debugging.

  5. Review, Edit, and Apply

    Review the generated code, make any refinements, and apply it to the widget or event. The story designer remains the final authority , the AI assists, but does not override user control.

See it in Action

 

Practical Use cases

The following represent typical scenarios where AI-assisted story code generation delivers measurable value:

Reading Data from a Data Source

Check whether a data source has results, read specific cell values by dimension member, get all dimension members, count members, check whether a specific member exists etc.  Multi-cell comparisons , read values for two members, compare them, and display which is higher , follow the same data access pattern.

Widget State Control

Toggle widget visibility, enable or disable buttons, and update text labels,  including conditional branching based on current state. For example: "if Chart_1 is visible, hide it and set the button text to 'Show Chart'". Reacting to a user selection,  such as updating a label when a chart data point is selected , falls into this pattern as well.

Dynamic and Conditional Filtering

Filter a chart or table by a dimension member, remove filters, and apply a user selection as a filter (for example, from a dropdown). This extends to filtering by multiple members, copying filters from one chart to another, applying the same filter across several charts simultaneously, and conditional filter-or-clear logic. Handles multi-select, deselect, and empty-selection edge cases. 

Chart and Table Configuration

Add or remove dimensions from chart feeds (CategoryAxis, Color, ValueAxis), sort by value, rank to top N, set fixed axis scale ranges, and open the data analyzer. For tables: add dimensions to rows or columns, enable zero suppression, toggle compact display, and move a dimension between rows and columns. Dynamic configuration, switching chart dimensions or rearranging which dimensions appear on table rows and columns based on a dropdown selection , follows the same pattern.

Input Validation and Form Logic

Validate required fields (not empty, numeric, contains '@'), enable a submit button only when all inputs are filled, clear all fields, and collect form values into a display summary. Combined patterns include validating all form fields before submit and validate-then-execute sequences.

Planning Workflow Automation

Execute data actions, show a busy indicator during execution, check the execution result status, lock and unlock planning data, and set data action parameters from a dropdown before executing.

 

Permissions & Prerequisites

To use AI-Assisted Story Code Generation in SAP Analytics Cloud, the following permissions must be granted to the user or role within the tenant:

Permission TypePrivilegePurpose
Execute PermissionGenerative AI PrivilegeEnables the user to invoke the AI code generation engine within the script editor.
Create PermissionApplications PrivilegeAllows the user to create and modify optimized stories in which the generated scripts are applied.

ℹ️  Administrator Note

Both permissions must be configured in the SAP Analytics Cloud before users can access AI-assisted story code generation. Tenant administrators should assign these privileges as part of standard AI feature onboarding for story designers or developers.

 

Considerations for Adoption

While AI-assisted story code generation significantly reduces friction, a few considerations are relevant for teams planning adoption:

Review and Validation: AI-generated code should always be reviewed before deployment, particularly in production stories that serve business-critical reporting. The generated script reflects common patterns but may require adjustment for complex or edge-case scenarios.

Governance: As with any AI-generated content, organisations should consider establishing review practices and code standards to ensure that AI-assisted story scripts align with organisational conventions for maintainability and auditability.

Activation: The official SAP documentation provides a step-by-step guide to activating this feature in your SAP Analytics Cloud tenant.  This is a base AI-feature offered free of charge.

 

Outlook

AI-Assisted Story Code Generation is already a powerful capability in its own right, but it is also a stepping stone toward a fundamentally different way of working with SAP Analytics Cloud. Looking ahead, this feature will be integrated into the Joule workflow and delivered as part of Joule with SAP Analytics Cloud.

What this means in practice is that story scripting will become a conversational experience. Instead of opening a dedicated script editor and prompting the AI separately, story creators will be able to describe what they want their story to do, directly inside the Joule, and have the required JavaScript generated, explained, and inserted in the script editor. 

Story scripting has always rewarded those who master it. With AI handling the heavy lifting, that reward is now extended to a broader audience, not just the few who know every API by heart. Less time spent on code, more time spent on the insight it delivers. AI-Assisted Story Code Generation sets the pace , and the best is still ahead.

3 Comments

Thanks! very very useful and well explained btw... now I am assigning the IA capabilities to my user!

thanks again!

Akbarali_DnA
Explorer
Impressive capability. One thing I'm curious about is where SAP sees the boundary between AI-assisted scripting and AI-assisted story creation. Generating SAC script from natural language is a great first step, but many customers will eventually expect to describe a dashboard, planning input form, or analytical workflow in business terms and have SAC assemble much of the required functionality automatically. It will be interesting to see how far SAP plans to take this beyond code generation.
jie_deng
Product and Topic Expert
Product and Topic Expert

@Akbarali_DnA 

Thanks for your comment! We are planning to deliver the Data & Analytics Insights Agent, which will be able to automatically generate data-driven stories based on natural language queries, by the end of September or Q4 this year. You can find more details in the Roadmap Explorer here: https://roadmaps.sap.com/board?PRODUCT=67838200100800006884&range=CURRENT-LAST#Q3%202026;INNO=1D0C03...
Thanks and Best Regards
Jie