In the Open source BI product Helical Insight BI application, there are a lot of Properties options which can allow us to customize a lot of chart related properties like color, color palette, formatting and much more. The properties applied and used here are hard coded in the report definition.

But in many cases we can have situations in which we would like to dynamically change the properties based on the certain condition.

Example: We have created a chart with some color theme. For every user we would like a different color theme to get applied. In those cases Operations can be used. In this blog we are going to cover how to do the same.

Operations allows to put code at these 4 placeholders:

  • Preexecution
  • Prefetch
  • Postfetch
  • Postexecution

These hooks serve as extension points where you can inject custom logic in the form of JavaScript. This flexibility is especially valuable for use cases where the report behavior needs to change dynamically based on the user, environment, or data context.

Understanding Report Properties and Dynamic Variables

Every report in Helical Insight contains various report-level properties, such as chart configurations, color palettes, axis settings, and much more. These properties are stored in the report definition and can be accessed and manipulated during runtime via JavaScript.

To understand what properties are available in a report and what values they currently hold, developers can use the browser’s developer tools console. Executing the command:

console.log(properties);

This logs a complete object that represents all report properties. By inspecting this object, you can view what values are currently applied and which ones can be modified or overridden.

This approach is particularly useful when you want to dynamically change property values based on conditions such as user roles, profiles, or data filters. By leveraging this, developers can build reports that adapt in real-time based on the context in which they are being viewed. It enables the developer to inject logic that can alter visuals, filters, or formatting on-the-fly during report execution.

Use Case Example: Dynamic Color Palette Based on User Profile

Let’s consider a practical example involving the Color Palette property, which defines the color themes used in charts and visualizations.

In Helical Insight, administrators can assign profile attributes to users. These attributes are key-value pairs that describe user-specific metadata, such as location, department, or preferred chart colors.

Suppose you have two users:

  • User A has a profile attribute: colorPalette = “Vibrant”
  • User B has a profile attribute: colorPalette = “Muted”

When these users log into the application and open the same report, we want the chart colors to reflect their assigned palettes. Here’s how this can be achieved:

  1. Profile Assignment: At the time of user creation or authentication, assign each user relevant profile attributes.
  2. Accessing Session Variables: Within the report operations (e.g., Preexecution), you can access the user’s profile using session variables like: user. You can console.log(user) to see the details of currently logged in user.
  3. Updating Report Properties Dynamically: Using this value, update the color palette property of the chart dynamically:
    var colorPaletteProfile = user.profile.find(p => p.profileName === "colorPalette");
    if (colorPaletteProfile && colorPaletteProfile.profileValue) {
      const newPalette = colorPaletteProfile.profileValue.split(',').map(item => item.trim());
      properties.chartTheme.colorPalette = newPalette;
    }

Explanation:

  • The user object is a built-in session object available in the runtime.
  • The .profile array holds key-value objects for each user-specific profile attribute.
  • We look for the colorPalette profile.
  • If it exists, we parse its value (which is a comma-separated string) into an array.
  • Finally, we assign this array to the colorPalette property of the chart.

As a result, the same report dynamically adapts the chart color theme based on who is logged in. User A will see one set of colors, while User B sees a completely different palette — all without changing the report or creating multiple versions of it.

Result: When the report is executed, User A will see charts using the “Vibrant” palette, while User B will see the same charts styled with the “Muted” palette, thus offering a personalized reporting experience.

In the above use case we have considered the assigned profile value to a user. But in the condition code which we wrote in the operations, we can check and update based on anything like user name, roles, organization, profile attribute and profile value.

Benefits of Dynamic Operations

  • User Personalization: Tailor visuals, filters, and data formatting to match individual user preferences or roles.
  • Improved UX: Provide a more relevant and context-aware interface, improving user engagement.
  • Reduced Report Duplication: Instead of creating multiple versions of a report for different user types, use dynamic logic to reuse the same report.
  • Advanced Security and Data Handling: Enforce data-level restrictions or access controls dynamically using prefetch or postfetch logic.

Conclusion

Helical Insight’s Operations framework is a robust tool that unlocks tremendous customization and automation capabilities in report generation and user experience. By using session-based variables, report properties, and scripting, developers can implement sophisticated business logic that reacts in real time to who is viewing the report and under what conditions. This leads to a more intelligent, efficient, and scalable reporting solution. This not only enhances the user experience but also ensures scalability and maintainability across large deployments.

Leave a Reply

Helical Insight’s self-service capabilities is one to reckon with. It allows you to simply drag and drop columns, add filters, apply aggregate functions if required, and create reports and dashboards on the fly. For advanced users, the self-service component has ability to add javascript, HTML, HTML5, CSS, CSS3 and AJAX. These customizations allow you to create dynamic reports and dashboards. You can also add new charts inside the self-service component, add new kind of aggregate functions and customize it using our APIs.
Helical Insight’s self-service capabilities is one to reckon with. It allows you to simply drag and drop columns, add filters, apply aggregate functions if required, and create reports and dashboards on the fly. For advanced users, the self-service component has ability to add javascript, HTML, HTML5, CSS, CSS3 and AJAX. These customizations allow you to create dynamic reports and dashboards. You can also add new charts inside the self-service component, add new kind of aggregate functions and customize it using our APIs.
Helical Insight, via simple browser based interface of Canned Reporting module, also allows to create pixel perfect printer friendly document kind of reports also like Invoice, P&L Statement, Balance sheet etc.
Helical Insight, via simple browser based interface of Canned Reporting module, also allows to create pixel perfect printer friendly document kind of reports also like Invoice, P&L Statement, Balance sheet etc.
If you have a product, built on any platform like Dot Net or Java or PHP or Ruby, you can easily embed Helical Insight within it using iFrames or webservices, for quick value add through instant visualization of data.
If you have a product, built on any platform like Dot Net or Java or PHP or Ruby, you can easily embed Helical Insight within it using iFrames or webservices, for quick value add through instant visualization of data.
Being a 100% browser-based BI tool, you can connect with your database and analyse across any location and device. There is no need to download or install heavy memory-consuming developer tools – All you need is a Browser application! We are battle-tested on most of the commonly used browsers.
Being a 100% browser-based BI tool, you can connect with your database and analyse across any location and device. There is no need to download or install heavy memory-consuming developer tools – All you need is a Browser application! We are battle-tested on most of the commonly used browsers.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
We have organization level security where the Superadmin can create, delete and modify roles. Dashboards and reports can be added to that organization. This ensures multitenancy.
A first-of-its-kind Open-Source BI framework, Helical Insight is completely API-driven. This allows you to add functionalities, including but not limited to adding a new exporting type, new datasource type, core functionality expansion, new charting in adhoc etc., at any place whenever you wish, using your own in-house developers.
A first-of-its-kind Open-Source BI framework, Helical Insight is completely API-driven. This allows you to add functionalities, including but not limited to adding a new exporting type, new datasource type, core functionality expansion, new charting in adhoc etc., at any place whenever you wish, using your own in-house developers.
It handles huge volumes of data effectively. Caching, Pagination, Load-Balancing and In-Memory not only provides you with amazing experience, but also and does not burden the database server more than required. Further effective use of computing power gives best performance and complex calculations even on the big data even with smaller machines for your personal use. Filtering, Sorting, Cube Analysis, Inter Panel Communication on the dashboards all at lightning speed. Thereby, making best open-source Business Intelligence solution in the market.
It handles huge volumes of data effectively. Caching, Pagination, Load-Balancing and In-Memory not only provides you with amazing experience, but also and does not burden the database server more than required. Further effective use of computing power gives best performance and complex calculations even on the big data even with smaller machines for your personal use. Filtering, Sorting, Cube Analysis, Inter Panel Communication on the dashboards all at lightning speed. Thereby, making best open-source Business Intelligence solution in the market.
With advance NLP algorithm, business users simply ask questions like, “show me sales of last quarter”, “average monthly sales of my products”. Let the application give the power to users without knowledge of query language or underlying data architecture
With advance NLP algorithm, business users simply ask questions like, “show me sales of last quarter”, “average monthly sales of my products”. Let the application give the power to users without knowledge of query language or underlying data architecture
Our application is compatible with almost all databases, be it RDBMS, or columnar database, or even flat files like spreadsheets or csv files. You can even connect to your own custom database via JDBC connection. Further, our database connection can be switched dynamically based on logged in users or its organization or other parameters. So, all your clients can use the same reports and dashboards without worrying about any data security breech.
Our application is compatible with almost all databases, be it RDBMS, or columnar database, or even flat files like spreadsheets or csv files. You can even connect to your own custom database via JDBC connection. Further, our database connection can be switched dynamically based on logged in users or its organization or other parameters. So, all your clients can use the same reports and dashboards without worrying about any data security breech.
Our application can be installed on an in-house server where you have full control of your data and its security. Or on cloud where it is accessible to larger audience without overheads and maintenance of the servers. One solution that works for all.
Our application can be installed on an in-house server where you have full control of your data and its security. Or on cloud where it is accessible to larger audience without overheads and maintenance of the servers. One solution that works for all.
Different companies have different business processes that the existing BI tools do not encompass. Helical Insight permits you to design your own workflows and specify what functional module of BI gets triggered
Different companies have different business processes that the existing BI tools do not encompass. Helical Insight permits you to design your own workflows and specify what functional module of BI gets triggered