Knowledge Base Article

Using text widgets to present script, plugin, and BloX action information

Sisense Text Widgets can be programmatically updated to display messages generated from scripts, plugins, or Blox actions. This provides a non-intrusive and non-disruptive method for showing contextual information directly within the dashboard, avoiding the interruptions of alerts or pop-ups created by custom code, are present in PDF and image exports, and removing the need for viewers to check the browser console. Messages can confirm when custom code has executed or highlight exceptions where a condition was not present requiring a custom code dashboard modification. (Applicable to Sisense version 2023.11 and later | Cloud and On-Prem deployments.)

Step-by-Step Guide:

  1. Navigate to the dashboard where you want to display contextual messages.
  2. Add a Text Widget to the dashboard and place it in a visible location for status or context information.
  3. Open the Dashboard or widget Script Editor or add code within a custom plugin/Blox action.
  4. Use the following snippet to update the first text widget with a message:
if (adjustmentMade && adjustmentMessages.length) { const $widget = $('#editor-container > div.wd').first(); if ($widget.length > 0) { $widget.text(adjustmentMessages.join(" ")); } else { console.log(adjustmentMessages.join(" ")); } }

5. Save and refresh the dashboard. The message will appear inside the designated text widget.

Extended Example:

The following example shows how this can be integrated into a script that listens for filter changes and displays a message when adjustments occur. If a text widget exists, the message appears there; otherwise, the console is used as a fallback.

function showMessage(msg) { const $textWidget = $('#editor-container > div.wd').first(); if ($textWidget.length > 0) { $textWidget.text(msg); } else { console.log(msg); } } // Example usage: notify when filters are changed dashboard.on("filterschanged", function () { showMessage("Dashboard filters were updated programmatically."); });

The screenshot below shows a Sisense dashboard with a Text Widget displaying a message triggered by a dashboard script. The message is clearly visible alongside other widgets, ensuring users receive relevant information without disruption.

 

Additional Example Integrated in a Larger Script:

In more advanced implementations, text widgets can be embedded into larger custom scripts or plugins. For example, a script handling filter validation and redirection may also push user-facing messages to a text widget to explain adjustments. Instead of exposing all internal logic, only relevant updates (such as date range corrections) are displayed to users:

// Inside a larger script - update text widget when filter is adjusted if (adjustmentMade && adjustmentMessages.length) { const $widget = $('#editor-container > div.wd').first(); if ($widget.length > 0) { $widget.text(adjustmentMessages.join(" ")); } else { console.log(adjustmentMessages.join(" ")); } }

Conclusion:

Using Text Widgets as a communication surface allows scripts, plugins, and Blox actions to deliver contextual messages directly in the dashboard. This improves the end-user experience by providing visibility into background custom code operations or automated changes without requiring web console viewing or intrusive pop-up dialogs. A consistent placement of text widgets across dashboards is recommended to standardize messaging and ensure clarity.

Disclaimer: This post outlines a potential custom workaround for a specific use case or provides instructions regarding a specific task. The solution may not work in all scenarios or Sisense versions, so we strongly recommend testing it in your environment before deployment. If you need further assistance with this, please let us know.

Published 08-15-2025

1 Comment

  • JeremyFriedel's avatar
    JeremyFriedel
    Sisense Employee

    The code appears to not have line breaks when viewed in some browsers, here is the code with line breaks:

    if (adjustmentMade && adjustmentMessages.length) {
        const $widget = $('#editor-container > div.wd').first();
        if ($widget.length > 0) {
            $widget.text(adjustmentMessages.join(" "));
        } else {
            console.log(adjustmentMessages.join(" "));
        }
    }
    

     

    function showMessage(msg) {
        const $textWidget = $('#editor-container > div.wd').first();
        if ($textWidget.length > 0) {
            $textWidget.text(msg);
        } else {
            console.log(msg);
        }
    }
    
    // Example usage: notify when filters are changed
    dashboard.on("filterschanged", function () {
        showMessage("Dashboard filters were updated programmatically.");
    });
    

     

    // Inside a larger script - update text widget when filter is adjusted
    if (adjustmentMade && adjustmentMessages.length) {  
        const $widget = $('#editor-container > div.wd').first();  
        
        if ($widget.length > 0) {  
            $widget.text(adjustmentMessages.join(" "));  
        } else {  
            console.log(adjustmentMessages.join(" "));  
        }  
    }