Skip to main content
Sisense Community logo
  • Community Feedback
  • Chapters
  • Events
    • Help and How To
    • Product Feedback Forum
    • Strategy & Use Cases
  • Blogs
    • KB Docs
    • Add-Ons & Plug-Ins
    • APIs
    • Best Practices
    • Blox
    • CDT
    • Cloud Managed Service
    • Data Models
    • Data Sources
    • Embedding Analytics
    • How-Tos & FAQs
    • Onboarding
    • PySisense
    • Security
    • Sisense Administration
    • Sisense Intelligence & AI
    • Troubleshooting
    • Widget & Dashboard Scripts
  • Support
    • Sisense Academy: Free Courses and Certifications
    • Official Developer Documentation
    • Official Product Documentation
    • Official Sisense Youtube Channel
    • Sisense Compose SDK Playground
  • Use Case Gallery
Loading…
   
All PostsDiscussionsBlogsIdeasQuestions
Leaderboards
                   
  •                    
                   
  •                    
  •                    
  •                    
  •                    
                   
  •                    
  •                    
  •                    
  •                    

  •                    
  •                    
  •                    
                   
  •                    
  •                    
  •                    
Discussions
  • TagsChevronRightIcon
Add-Ons
    • Add-ons & Plug-InsChevronRightIcon

    Custom Map Widget (Sisense for Linux)

                                     

    Version: 1.0.5 (November 2026) · Tested on: Sisense for Linux 2026.4.0-d · Download: customMapWidget_1.0.5+LinuxSample.zip Update, November 2026: The plugin has been updated for Sisense for Linux. The background map now uses the same map service as the built-in Scatter Map, so you don't need your own Mapbox key. PDF export, saving the map position and click-to-filter have been fixed. A Linux sample (data model and dashboard) is included. The original Windows instructions have been removed. Introduction Sisense's built-in maps cover countries, US states and points. The Custom Map widget lets you color any set of shapes by a value from your data: counties, sales territories, zip code areas, provinces, or your own regions. Each shape comes from a GeoJSON file, and the widget matches it to a field in your data model. Features Shapes drawn on top of the standard Sisense background map, or on their own. Colors follow the value's color settings (single color or range). A tooltip shows the label and value of the shape under the mouse. Clicking a shape adds a dashboard filter for it. An optional Restore Position setting keeps the map's position and zoom between visits. Works in PDF and image exports. What's in the download customMapWidget/ : the plugin, including 4 maps: US Counties US 3-digit Zip Codes Canada Provinces China Provinces Sample Elasticube/ : a sample you can import: CustomMaps-<date>.sdata : the data model with data CustomMaps.smodel : the data model only CustomMaps.dash : the dashboard the source Excel files Step 1: Install the plugin Unzip the download. Only the customMapWidget folder goes into Sisense. Add it to Sisense in one of these ways: Admin > App Configuration > File Management → open the plugins folder → upload the customMapWidget folder. If File Management isn't shown, a system admin can turn it on under Admin > App Configuration > Feature Management . Or copy it on the server to /opt/sisense/storage/plugins/customMapWidget . Wait a minute for Sisense to load the plugin, then hard-refresh the browser (Ctrl+F5 / Cmd+Shift+R). Check that customMapWidget appears in the Add-ons list under Admin and is enabled. When you create a widget, Custom Map is now in the widget type list. Step 2: The background map The plugin uses the same map service as the Sisense Scatter Map : the geo.maps_api_provider system setting. You don't need to configure anything. If Scatter Map widgets show a background map on your system, Custom Map will too. Self-hosted systems older than L2025.2 SP2: Sisense replaced its map service token in L2025.2 SP2, and the old token stopped working on 30 Sep 2025. If your maps are grey, upgrade or update the token as described in Scatter Map – Mapbox Upgrade . To use a different map service, set urlTemplate in customMapWidget/config.js (for example 'https://tile.openstreetmap.org/{z}/{x}/{y}.png' ). Leave it empty to use the Sisense setting. Step 3: Load the sample (optional) The sample shows US population by county. Data model: on the Data page, click Import Model and choose: CustomMaps-<date>.sdata , which includes the data, so you can use it right away without a build; or CustomMaps.smodel , which is the model only. Point its Excel connections to the Excel files from the download, then build. Dashboard: on the Analytics page, open the menu (⋮) next to the dashboards list, choose Import Dashboards , and select CustomMaps.dash . The sample model has two US tables, linked by one relationship: US County Geo : FIPS Code : the 5-digit county code, e.g. 01001 County Full : e.g. Autauga County, Alabama US County Data : Label : e.g. Autauga County, Alabama Population Date Relationship: US County Data.Label ↔ US County Geo.County Full Step 4: Create the widget Using the US sample as the example: On a dashboard, add a widget, select the CustomMaps model, choose the Custom Map widget type, and open Advanced Configuration . On the right, under Map Type , select US Counties . This picks the GeoJSON file the plugin loads. The default is Canada , so always check this first. Fill in the panels: Geography (required): US County Geo.FIPS Code . Must match the map's key (see below). Label (optional): US County Data.Label . Text shown in the tooltip. Value (required): SUM(Population) . The number for each shape. Set its color to Range to get a gradient. Add a Years in Date filter (on the widget or the dashboard). The sample has more than one year per county, so without it the values add up across years. Optional: in the design panel, turn on Restore Position to keep the map's position and zoom. Each panel accepts one field. Geography and Label take plain fields; Value takes an aggregation or formula. How shapes are matched to your data Each map in config.js names the GeoJSON properties that identify a shape ( keyAttributes ). The Geography values must match them, ignoring upper/lower case and surrounding spaces. US Counties : key STATE + COUNTY . Values are 5-digit FIPS codes, e.g. 01001 , 06037 , 48201 . US Zip Codes (3-digit) : key NAME . Values like 005 , 100 , 997 . Canada : key NAME . Values like Alberta , Ontario , Yukon Territory , Newfoundland & Labrador (two spaces). China Provinces : key name . Values like Beijing , Guangdong , Inner Mongol , Xizang . Rows that don't match any shape are simply not drawn. In the sample, about 180 counties have no data because the names in the two Excel files differ (for example Louisiana parishes and Alaska boroughs). Step 5: Add your own map Get a GeoJSON file with your shapes, in WGS 84 (latitude/longitude) coordinates. Sources include Natural Earth and government open-data portals. MyGeoData can convert shapefiles and other coordinate systems. Large files load slowly; mapshaper can simplify them. The file must be a FeatureCollection , and each feature needs the properties you'll match on: { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "ID": "1", "Name": "MyShape1" }, "geometry": { "type": "Polygon", "coordinates": [[[-86.411172, 32.409937], [-86.496774, 32.344437], [-86.45, 32.30], [-86.411172, 32.409937]]] } } ] } Add it to the plugin: put the file in customMapWidget/geojson/ . Use the .js extension like the included maps, then upload it through File Management. Register it in customMapWidget/config.js by adding an entry to maps : { label: 'My Territories', // name shown under Map Type url: '/plugins/customMapWidget/geojson/my-territories.js', // path to the GeoJSON file showBaseMap: true, // false = shapes only, no background map keyAttributes: ['Name'], // GeoJSON properties that identify a shape keySeparator: '', // joins several keyAttributes, e.g. STATE + COUNTY }, Wait for the automatic plugins rebuild and hard-refresh the browser. The new map appears under Map Type . Settings in config.js urlTemplate : background map tile URL. Leave empty to use the Sisense map service (recommended). shapeSeparatorColor : outline color of the shapes. shapeHighlightColor : outline color of the shape under the mouse. maps[] : one entry per map type, with label , url , showBaseMap , keyAttributes and keySeparator (see Step 5). Troubleshooting Custom Map isn't in the widget type list: Check that the folder is plugins/customMapWidget with plugin.json directly inside it. Check that the add-on is enabled under Admin. Hard-refresh the browser. The map is empty: Check that Map Type matches your data. Check that Geography holds the key field (code or name, as listed above), not a description. Some shapes are missing: the values in your data don't match the GeoJSON keys exactly (spelling, abbreviations, code column format). Most shapes have the same color: the values are very uneven (for example one huge county and many small ones). Set the Value color's range manually. The background is grey: check whether Scatter Map widgets show a background map. If they don't, see Step 2. Values look too high: add a date or year filter; the data may have several periods per area. Upgrading from an older version: Replace the whole customMapWidget folder. Re-apply your own maps entries in the new config.js . Keep urlTemplate empty. Windows: this version is tested for Sisense for Linux only. References GeoJSON format (RFC 7946) Leaflet 0.7 documentation : the mapping library Sisense includes Natural Earth MyGeoData converter mapshaper Sisense docs: Installing add-ons Exporting and importing data models Uploading files with File Management

    intapiuser
    intapiuser
    3
             
  • Discussion
    Hamza Jap-Tjong
    • Strategy & Use Cases
             
    Hamza Jap-Tjong
    Text Pivot: a pivot widget that shows text values instead of aggregations
             

    Hi all, We have a lot of vertical orientated tables. An example is our questionnaire table. This contains all our questionnaire-types with their questions and user-answers. We ourselves, but also our users, would like to combines these in a pivot style way, but that was not possible with the current Sisense Pivot Table. And datamodelling became to cumbersome to do this for every questionnaire (we have around 300 types). The built-in Pivot only allows aggregations at a row × column intersection. That works for numbers, but not when the value you want to show is text. Our questionnaire data stored in a "text" format is the classic case: I wanted one row per form, one column per question and the actual answer in each cell. The workarounds I found meant either mapping answers to numeric codes with javascript or reshaping the data model every time a question was added. So I built a widget plugin instead with the new ComposeSDK. Setting it up The data panel has three slots: Rows: up to 3 fields, for example form ID and location Columns: 1 field, for example question Value: a text field, used as is with no aggregation When a cell has more than one value, you choose whether to join them (with your own separator), keep the first, or keep the last. Rows and columns have a default sort order (A→Z, Z→A, or order of appearance). You can also click any header to sort by that column, including by the answers in a question column and empty cells always end up at the bottom. Wide tables were the main usability problem, so the header row and the row-field columns stay frozen when you scroll sideways. Text wrapping and the width of the row columns are both settings. The row limit counts table rows (forms in this example), not the records underneath. Limiting raw records would cut forms off halfway, so the widget fetches complete forms only and shows a notice when there are more than the limit. The native PDF export only captures the part of a widget you can see, so I added export buttons for the whole table: CSV, Excel (.xlsx with a frozen header) and PDF (A4 landscape, with the header repeated on every page and extra pages sideways for very wide tables). Dashboard filters apply to it like any other widget. How it's built It's a Compose SDK widget plugin, created with the Plugin DevX toolchain ( npx @sisense/sdk-cli create-plugin , React and TypeScript) and uploaded to Sisense as a plugin. I tested it on Sisense 2026.3.2, Linux. The data comes from useExecuteQuery with ungroup: true , and the pivoting happens in the browser. For the row limit, the widget first counts the distinct column values, then fetches just enough rows, sorted by the row fields, to fill the requested number of complete table rows. Four things I ran into while building it If you build plugins yourself, these may save you some time. At runtime the plugin doesn't use the SDK version in your package.json . It runs on the host's copy ( window["@sisense/sdk-ui"] ), so check that every API you call exists in the version your instance ships. Sisense's own CSS also styles MUI class names. In my case it turned the design-panel labels white on a light background. Explicit colors on a wrapper with more specific selectors fixed it, plus !important for the labels. Dropdown menus render outside the widget, so they need their own styling via slotProps . Adding PDF export with jsPDF made the bundle balloon. The Sisense build is a single IIFE file, so jsPDF's optional dependencies (html2canvas, canvg) got inlined even though the plugin never uses them. A scoped npm overrides entry that points them at tiny local stubs brought the bundle back to about 860 KB. If your widget measures its container, for a canvas or a chart, attach the ResizeObserver through a callback ref. The widget renders its loading state first, so a useEffect(..., []) on a regular ref never sees the element and the size stays at zero. Getting it Download it here Limitations The pivoting runs in the browser, so it's meant for tens of thousands of underlying rows, not millions. With bigger sets, use filters or the row limit. There's one column field for now, with no nested column headers, and clicking a cell doesn't cross-filter other widgets yet. How do you handle text values in pivots today: a data-model change, a script on the native pivot, or something else? I'd also like to know whether there's a cleaner approach I missed and which feature you'd want added first. :) Hamza

    1
             
    • Add-ons & Plug-InsChevronRightIcon

    [Linux] Add-on to hide any widget type

                     

    The hideWidgets plugin is a small customization that hides every BloX widget on a dashboard. A common follow-up question is: can the same plugin hide a different widget type too — for example, a Sankey chart? The answer is yes. The plugin hides widgets by matching their widget.type value, so it can target any type once you know the correct string. Building the plugin from scratch If you don't already have a copy of the plugin, you can create one in a few minutes. A Sisense add-on is just a folder containing a manifest file ( plugin.json ) and one or more JavaScript files. 1. Create the folder and files Create a folder named hideWidgets with two files inside it: hideWidgets/ ├─ plugin.json // the manifest └─ main.6.js // the plugin logic 2. Add the manifest (plugin.json) The manifest tells Sisense how to load your add-on. This example uses add-on infrastructure version 2, which is supported on modern Sisense versions: { "name": "hideWidgets", "pluginInfraVersion": 2, "isEnabled": true, "source": ["main.6.js"], "style": [], "version": "1.0.0" } name — a unique add-on name. pluginInfraVersion — the add-on infrastructure version (2 supports modern JavaScript). source — the list of JavaScript files to load. version — bump this every time you change the code (see the caching note later — this is what forces Sisense to load the new copy). 3. Add the logic (index.js) This is the complete, working plugin. It hides every widget whose type appears in the typesToHide list. Start with just 'blox' , and add more types once you have confirmed them (covered in the next sections): // hideWidgets - hides widgets by their widget.type value prism.on('dashboardloaded', function(ev, args) { var dashboard = args.dashboard; // Add every widget type you want to hide to this list var typesToHide = ['blox']; dashboard.widgets.$$widgets.forEach(function(widget) { if (typesToHide.indexOf(widget.type) !== -1) { if (widget.container) { widget.container.style.display = 'none'; } } }); }); Keep the hide list in one place (the typesToHide array). Adding a new widget type later is then a one-line change, with no other edits needed. Installing the plugin Sisense loads add-ons from a dedicated plugins folder. Once your hideWidgets folder is in place, Sisense picks it up and it appears in the Admin UI. Sisense for Linux (including Cloud) In Sisense, go to Admin → System Management → File Management . Open the plugins folder (the server path is /opt/sisense/storage/plugins/ ). Upload your hideWidgets folder (or a .zip of it, then extract) so the files sit at /opt/sisense/storage/plugins/hideWidgets/ . Go to Admin → Add-ons and confirm the add-on is listed and enabled. Cloud customers - On Sisense Cloud you have File Management access to the plugins folder, so you can upload the add-on yourself. If you cannot access it, open a support case and attach the plugin folder so it can be placed for you. Don't modify certified add-ons - Build your own folder rather than editing a certified Sisense add-on in place. Certified add-ons can be overwritten during an upgrade, which would discard your changes. How the hideWidgets plugin works On dashboard load, the plugin iterates over the dashboard's widgets and hides any widget whose type property equals "blox" . The core logic looks like this: prism.on('dashboardloaded', function(ev, args) { var dashboard = args.dashboard; dashboard.widgets.$$widgets.forEach(function(widget) { if (widget.type === 'blox') { widget.container.style.display = 'none'; // hide the widget } }); }); The exact code in your copy may differ slightly, but the principle is the same: it checks widget.type and hides matches. To hide another widget type, you extend the condition to also match that type's string. Why third-party widgets need an extra step Native Sisense widgets have well-known type strings. Third-party Marketplace widgets — such as the Sankey chart — are registered by the plugin that provides them, and their internal type string is defined by that plugin, not by Sisense. It is therefore not listed in Sisense's official documentation. Third-party widgets commonly register a type that resembles the plugin name (for example sankey , sankeyWidget , or a vendor-prefixed variant). Because the exact value can vary, you should confirm it directly rather than assume it. Step 1 — Find the widget's type string Open a dashboard that contains the widget you want to hide (for example, a Sankey chart). Open your browser's Developer Tools (press F12 ) and go to the Console tab. Run the snippet below to print the title and type of every widget on the active dashboard: prism.activeDashboard.widgets.$$widgets.forEach(function(w) { console.log('Title:', w.title, '| Type:', w.type); }); Find your target widget in the output and note its exact Type value (for example sankey or a vendor-prefixed string). Type strings are case-sensitive. Copy the value exactly as printed — a mismatch means the widget simply won't be hidden, with no error. Step 2 — Extend the plugin Open the plugin's main.6.js file inside the hideWidgets add-on folder and broaden the type check. The cleanest approach is to match against a list of types, so the plugin stays easy to extend later: prism.on('dashboardloaded', function(ev, args) { var dashboard = args.dashboard; // Add every widget type you want to hide to this list var typesToHide = ['blox', 'sankey']; // use the exact type from Step 1 dashboard.widgets.$$widgets.forEach(function(widget) { if (typesToHide.indexOf(widget.type) !== -1) { if (widget.container) { widget.container.style.display = 'none'; } } }); }); Guard for widget.container before setting its style. A widget that has not fully rendered may not expose a container yet, and referencing it blindly can throw a console error. Step 3 — Reload the plugin and clear the cache After editing the file, the change won't take effect — and you may see repeated console errors — if the browser or the plugin service is still running a stale copy of the JavaScript. This is the most common reason an edited plugin appears "broken" when the code is actually correct. Save the modified plugin file in the add-on folder. Disable and re-enable the add-on from Admin → Add-ons so the plugin service picks up the new code, then wait for the pods/service to restart. In the browser, do a hard refresh ( Ctrl+Shift+R / Cmd+Shift+R ) to discard the cached script. Reopen the dashboard and confirm the target widget is hidden and the console is clean. Repeated console errors after editing a plugin are frequently caused by a stale cached copy of the plugin JavaScript combined with a missing function reference — not by your new logic. Force a fresh load of the plugin (re-enable the add-on) and a hard browser refresh before troubleshooting further. A note on supportability Custom and community add-ons are not covered by Sisense product support in the same way certified add-ons are, and a customization may need re-testing after a Sisense upgrade. Keep a backup of the working plugin, and test any change in a non-production environment before deploying it. If a widget you need to hide has no native way to be disabled, extending a small plugin like this is the recommended approach.

    Vladyslav Hontar
    Vladyslav Hontar
    0
             
    • Add-ons & Plug-InsChevronRightIcon

    [Linux] Troubleshooting CommonReport Manager delivery failures

                                     

    Scheduled reports failing, arriving late, or stuck in pending ? This guide maps the most common delivery errors to their cause and fix, and shows exactly which logs to collect so we can resolve your case faster. Before you start: how delivery works Understanding the moving parts makes every error below easier to place. Report Manager runs as an add-on on the external-plugins pod and is made up of four cooperating services: Scheduler — decides when each report runs and holds a limited number of concurrency slots (default: 12 reports in parallel). Engine — generates the report (PDF, Excel, CSV, or dashboard link) for each recipient. Exporting service — renders the actual files; heavy pivots and large CSVs live here. Messaging — pushes live status updates to the Report Manager tab. Two settings govern throughput and are referenced throughout this guide, both under the Report Manager settings window (gear icon): Number of simultaneous reports — how many reports run at once before the rest go to the pending queue. Report Generation Timeout — seconds allowed per recipient before that recipient is marked timed-out ( 0 = unlimited). Step 1 — Read the status, then the right log Open the Report Manager tab and check the Last Run icon and Status column for the affected report: Red icon — the report failed. Hover for the error message; that string is your entry point into the table below. Orange icon — completed with warnings (usually a per-recipient timeout or an attachment-size limit). Pending that never becomes Running — a queue/scheduler problem, not an export problem. Go straight to the "stuck in pending" row. Which log to collect Report Manager writes to dedicated logs. Collect the ones matching your deployment and share them with the timestamp of a specific failed run: Cloud (Sisense-managed): you do not have shell access — instead, enable Support Access on the instance and share the report name, recipient, and the exact date/time of a failed run. We pull the pod logs on our side. Self-hosted Linux: from /var/log/sisense/sisense/ , collect the external-plugins pod log. Depending on the issue, it may also be useful to collect the exporting , exporter-xlsx and query . How to speed up your case: When you open a ticket, include all four of these up front: (1) the exact error text , (2) the report name and dashboard used in that report and one affected recipient , (3) the date/time of a failed run in your timezone, and (4) your Sisense version With these, we can locate the failure in the logs on the first pass instead of asking for a second round of details. Step 2 — Match the symptom to the cause and fix Find the section that matches your error string or symptom. Causes and fixes below are drawn from recurring, resolved cases. "Socket hang up" — often on Combined Excel or heavy reports, spiking under load Most likely cause: Multiple heavy reports run at the same time and compete for resources (common with Live data sources); a downstream request times out and drops the connection. When the underlying query itself fails or times out , the export gives up and the connection is dropped. In some cases a misbehaving add-on returns an error that cascades into the timeout. What to do: Stagger schedules so heavy reports don't all fire at once. Temporarily disable non-essential add-ons to isolate a culprit. If it persists under normal load, collect the external-plugins log around the failure time and open a ticket. When the report's underlying query is failing, also collect the query service logs — see "Collecting query logs" below for how to capture the right slice. Stuck in "Pending", never runs — including manual runs Most likely cause: The scheduler is not releasing concurrency slots, so the queue fills and nothing new can start. This is a known defect on older builds. What to do: Immediate — toggle Reports on hold on then off (or disable and re-enable the report) to reset the queue. Permanent — upgrade to 2026.2.1 or later, where the slot handling is fixed. "Report failed during initialization phase" — intermittent, succeeds on manual retry Most likely cause: A timing issue when several reports start at once and the Non-Sisense User email is not configured, so a recipient token resolves as empty. What to do: Set a valid Non-Sisense User email in the Report Manager settings (required whenever you send to external recipients). Permanent fix: 2026.1.1+ . "ENOENT: no such file or directory" / "Failed during export" Most likely cause: The export could not read or write an expected file. Frequently caused by an out-of-date export-related add-on or a missing local export path. What to do: Update Export Modifications (and other export add-ons) to the latest supported version. Verify the Local Export File Path exists and is writable. Disable other add-ons to isolate interference. Per-recipient timeout (orange "completed with warnings") Most likely cause: Report generation exceeded the Report Generation Timeout for that recipient — usually a heavy widget or large export. Large CSVs can also exceed the external-plugins pod memory (1 GB default). What to do: Increase the timeout value, or lighten the report (fewer widgets/rows). For large-CSV failures, raise the external-plugins pod memory. Ensure any load balancer / reverse proxy request timeout is ≥ 300 seconds . Intermittent SMTP timeout / authentication error on send Most likely cause: The report generated fine, but your custom email server refused or timed out the connection. What to do: Verify custom email server host, port, credentials, and that outbound SMTP is allowed by your firewall. This is outside Report Manager itself. Collecting query logs for a "socket hang up" When a socket hang up is driven by the report's underlying query — typically on a Live model or a heavy dashboard — the external-plugins log alone often isn't enough. Also collect the query service logs so we can see whether the query failed, timed out, or was cancelled on the engine side. Two things to keep in mind when pulling them: Match the timeframe to the failure. The query service is very high-volume, so capture only the window around the failed run — the minutes immediately before and after the error timestamp — rather than the whole file. A precise time (with timezone) makes the relevant lines easy to find. Older logs may already be archived/rotated. Because of the log volume, query logs are rotated frequently and older entries are compressed or moved to archived files. If the failure happened more than a short while ago, the live log may no longer contain it — look in the archived/rotated query logs for that period, or reproduce the failure and collect the logs promptly while they're still live. Cloud customers don't need to pull these manually — enable Support Access and share the exact failure time; we collect and correlate the query and external-plugins logs on our side. What to include when you contact us If the steps above don't resolve it, share the following so we can go straight to the underlying cause instead of asking for more detail: The exact error text from the report status. The report name and at least one affected recipient . The date and time (with timezone) of a specific failed run. Your Sisense version and whether the instance is Cloud or self-hosted. Logs: Cloud — enable Support Access; self-hosted — attach the external-plugins For query-driven failures (e.g. socket hang up on a Live model), also include the query service logs for the matching timeframe — check archived/rotated logs if the failure isn't recent. Whether the report is based on a Live model and whether it sends to external recipients . With a full picture we can pinpoint the underlying cause, confirm whether a known fix applies to your version, and bring anything unresolved to our engineering team for review.

    Vladyslav Hontar
    Vladyslav Hontar
    0
             
  • Discussion
    Mia Isaacson
    • Strategy & Use Cases
             
    Mia Isaacson
    Turning Sisense dashboards into client-ready reports 👉 See it live on Sept 17
                                     

    Exporting a dashboard as a PDF or PNG works fine when the audience is internal, and the need is simple. But as soon as a report needs to go out to different groups, with different branding, formatted for a specific audience, that's a different use case than a general export was ever built to solve. On September 17 , we're running a live demo of Report Studio, a report design and delivery layer built inside Sisense for exactly this gap: getting data out of Sisense in a format that's actually ready for a client, an exec, or anyone who isn't going to open a dashboard. This isn't a slide deck. It's a live build, start to finish. Here's what you'll see: Building a report from scratch: widgets, text boxes, a logo, and shapes added to the canvas, then exported manually A side-by-side of a native Sisense PDF export vs. the same data in Report Studio Applying a template to the report we just built, and how much manual layout work it removes Toggling between brands live on a single report, with the recipient's brand assigned automatically based on their user or group Token substitution across text boxes, file name, email subject, and email body Export by dimension, both on demand and as part of a scheduled delivery The actual email a recipient outside your organization receives, report attached Admin-side monitoring: job history and delivery oversight at scale Register here: https://www.qbeeq.io/webinars-register Drop questions here, and we'll answer them live during the webinar!

    0
             
    • TroubleshootingChevronRightIcon

    Resolving resize widget Issue when the Tabber Widget is in use

                             

    Introduction When using the Tabber widget, you may encounter issues where other widgets cannot be resized. This guide provides a step-by-step solution to resolve the problem by temporarily removing and recreating the Tabber widget while ensuring all widgets remain functional. Step-by-Step Guide Identify the Problem: Confirm that the issue is with the Tabber widget not allowing the resizing of other widgets on the dashboard. Delete the Tabber Widget: Before deleting the Tabber widget, copy any scripts associated with it. Remove the Tabber widget from the dashboard. Resize the Widgets: Resize the other widgets on the dashboard as needed. Ensure that the widgets are properly sized before re-adding the Tabber widget. Recreate the Tabber Widget: Add the Tabber widget back to the dashboard. Paste the previously copied script into the new Tabber widget. Verify the Solution: Check if the resizing issue is resolved in the duplicated dashboard. Ensure that the Tabber widget and other widgets are functioning correctly. Troubleshooting Tips Edit Mode Issues: If you cannot change the size of widgets in edit mode, try adding another widget next to the one you want to resize. This can sometimes resolve resizing issues. Conclusion By following the steps, you can restore full resizing functionality. If issues persist, try adding another widget nearby as a workaround. This ensures a smooth and flexible dashboard layout.

    Sisense User
    Sisense User
    3
             
  • Question
    • Help and How-ToChevronRightIcon
                     
    Create flawless pixel perfect reports on PDF, PPT and XLS directly within Sisense using Report Studio
    Ido Darnell
    Ido Darnell
    0
             
  • Discussion
    Ido Darnell
    • Sisense Partners
             
    Ido Darnell
    Pixel-perfect design and reporting for Sisense, a review of available options
                                                                                                                                             

    If you manage Sisense, you've had some version of this conversation: someone asks for a report that actually looks like a finished document, not a dashboard screenshot with the edges cut off. There are more ways to solve this than most admins realize, and each one solves a different piece of the problem. A quick rundown: Native PDF export - zero setup, but the layout is whatever the dashboard happens to produce. No control over page breaks, no way to add narrative text, and pivot tables cut off at the edge of the screen. Sisense Report Manager - solid scheduling and delivery, but it's still exporting the dashboard as-is. No design layer, no multi-dashboard composition. Jasper Reports - genuinely pixel-perfect for table and pivot widgets specifically, if you have developer resource to build and maintain JRXML templates. Doesn't touch charts or KPI widgets. SAP Crystal Reports via ODBC - full design control, but it pulls your data out of Sisense entirely to do it, which is a real consideration if data residency matters to you. Where this leaves most teams: something that handles scheduling, or something that handles pixel-perfect tabular data, but not both, and rarely anything that lets you design a report as its own document rather than a dashboard export. That's the gap QBeeQ Report Studio is built for: a canvas inside Sisense where you design the report as a report - pulling from multiple dashboards if you need to, with full control over layout, brand, and every widget on the page. Report Studio Deliver , our scheduled distribution layer, is coming in beta this month. For the full breakdown with a side-by-side comparison table, here's the complete write-up .

    0
             
  • Blog banner
    • Add-ons & Plug-InsChevronRightIcon

    Remove Whiskers from Box and Whisker Widgets

                                             

    Download Link: removeWhiskersFromBoxWhiskerPlot.zip Overview This customization removes the whiskers from Box and Whisker Plot widgets by hiding both the horizontal whisker caps and the vertical whisker lines. This can help simplify the visualization when the focus is only on the quartile ranges and median values. The solution is available in two formats: A widget script version for applying the customization to individual widgets A plugin/add-on version for applying the customization to all Box and Whisker widgets globally across dashboards In addition to removing the whiskers, the script/plugin also: Renames the tooltip labels from "Min" and "Max" to user-defined labels such as "Lower Quartile" and "Upper Quartile" Reorders the tooltip values so the median appears between the quartiles instead of at the end This can be useful for: Simplifying Box and Whisker visualizations Aligning terminology with statistical or business standards Making quartile-based visualizations easier for business users to interpret Standardizing tooltip terminology across dashboards Implementation / Installation Instructions 1. Widget Script Version The script removes the whiskers from Box and Whisker widgets. whiskerWidth controls the horizontal line at the end of the whiskers lineWidth controls the vertical lines above and below the boxes Both attributes are set to 0 to completely remove the whiskers from view. The tooltip labels can also be customized by updating the first three variables in the script. Script // Define the new names for the boxes' "Min", "Max", and "Median" labels const newBoxMaxName = "Upper Quartile"; const newBoxMinName = "Lower Quartile"; const newMedianName = "Median"; // Remove whiskers and lines widget.on('processresult', function(se, ev) { // remove horizontal lines at the end of whiskers ev.result.series[0].whiskerWidth = "0"; // remove vertical lines above and below boxes ev.result.series[0].lineWidth = "0"; }); // Remove whiskers information from tooltip and rename boxes' "Min", "Max", and "Median" to user-defined labels widget.on("beforedatapointtooltip", function(w, args){ args.template = "<div class=\"boxplot-tooltip\"><div class=\"boxplot-tooltip-data\"><div class=\"boxplot-tooltip-value-name\"> " + newBoxMaxName + " </div><div class=\"boxplot-tooltip-value\" data-ng-style=\"{color: model.memberColor}\"> {{model.boxMax}} </div></div><div class=\"boxplot-tooltip-data\"><div class=\"boxplot-tooltip-value-name\"> " + newMedianName + " </div><div class=\"boxplot-tooltip-value\" data-ng-style=\"{color: model.memberColor}\"> {{model.boxMedian}} </div></div><div class=\"boxplot-tooltip-data\"><div class=\"boxplot-tooltip-value-name\"> " + newBoxMinName + " </div><div class=\"boxplot-tooltip-value\" data-ng-style=\"{color: model.memberColor}\"> {{model.boxMin}} </div></div><div class=\"highcharts-tooltip-line-separator\"></div></div><div class=\"boxplot-tooltip-category\"><div class=\"boxplot-tooltip-value-category\"> {{model.xAxis}} </div></div></div>"; }); Steps Copy the script above. Open the widget’s script editor from the widget menu. Paste the script into the editor. Modify the quartile/median labels if needed. Save the script. Refresh the widget. 2. Plugin / Add-on Version This version applies the customization globally instead of configuring each widget individually. Installation Steps Download and unzip the plugin zip file . Extract the files directly. Do not create an additional folder level; the plugin files are already organized correctly within the zip file. Upload the removeWhiskersFromBoxWhiskerPlot folder to the Sisense plugins directory ( /opt/sisense/storage/plugins ). This folder can be accessed from Admin tab -> App Configuration -> File Management -> plugins . Check the Add-ons page in the Admin tab under Server & Hardware and confirm the plugin is listed and enabled. To modify the quartile and median labels, open the config.js file inside the plugin folder and update the configuration values (see more details in the Configurations section below), then save the file. Wait approximately 30–60 seconds for the plugin service to restart. Configurations The following configuration values can be customized to control the labels displayed in the tooltip to any preferred naming convention. newBoxMaxName Controls the label displayed for the top edge of the box (labeled "Max" in the default tooltip). Example: "Upper Quartile" newBoxMinName Controls the label displayed for the bottom edge of the box (labeled "Min" in the default tooltip). Example: "Lower Quartile" newMedianName Controls the label displayed for the median value shown inside the box. Example: "Middle Quartile" 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.

    Tri Anthony
    Tri Anthony
    0
             
  • Blog banner
    • PySisenseChevronRightIcon

    Managing Sisense Plugin States with PySisense

                                                                                                     

    Managing Sisense Plugin States with PySisense Overview Enabling and disabling Sisense plugins through the admin interface becomes time consuming when maintaining consistent plugin configurations across environments, testing against a clean instance, or iterating on plugin development. This article describes plugin_manager_pysisense.py , a Python command-line tool that manages Sisense plugin states using the PySisense library and a configuration file. The script is also a working example of how PySisense can be used for Sisense automation. This tool covers the same functionality as plugin_manager.py , documented in Managing Sisense Plugin States via the REST API . The difference is that this version delegates all API request code to PySisense rather than using the requests library directly. The two scripts share the same config.yaml format and produce identical output. The script enables and disables plugins, isolates a single plugin for faster development builds, and saves and restores named snapshots of plugin state. It does not install, uninstall, or update plugins, and does not roll back plugin versions. About PySisense PySisense is introduced in PySisense: Programmable Sisense Environment Management on the Sisense Community as a Python SDK for the Sisense REST API. It provides wrappers around common Sisense operations, including plugin management, dashboard access, and user administration. It is installed via pip and does not need to be placed alongside the script. This script provides a practical example of PySisense applied to a real automation task. Using PySisense rather than writing directly against the REST API reduces the amount of code required and removes several categories of boilerplate. Authentication headers, HTTP session management, SSL configuration, pagination across large result sets, and request logging are all handled by the library. The consistent SisenseClient and module pattern also makes it straightforward to extend a script to cover other Sisense operations, such as users, dashboards, or data models, without reworking connection and authentication code. Scripts built on PySisense are shorter and easier to read than equivalent scripts built on requests directly, and the library is maintained and tested independently of the scripts that use it. Note: The current release of PySisense on PyPI does not yet include the Plugins module used in this script. This functionality is planned for the next PySisense release. The development branch of the PySisense repository already contains it and can be installed directly from there. This script uses the Plugins class from PySisense: get_all_plugins() returns the full plugin list as a list of dicts, handling the pagination in the underlying API automatically. enable_plugins(names, bulk=True) enables one or more plugins by name. When bulk=True , all changes are sent in a single PATCH request. disable_plugins(names, bulk=True) disables one or more plugins by name, with the same bulk option. A SisenseClient instance is constructed from the config values and passed to the Plugins class. All HTTP calls are then handled by PySisense. from pysisense import Plugins, SisenseClient client = SisenseClient(domain="https://your-sisense-instance.com", token="YOUR_TOKEN") plugins = Plugins(api_client=client) # List all installed plugins all_plugins = plugins.get_all_plugins() # Enable plugins by short name, full name, or folderName result = plugins.enable_plugins(["SwitchDimension", "plugin-CustomPlugin"], bulk=True) # Disable plugins result = plugins.disable_plugins(["UnneededPlugin"], bulk=True) Both enable_plugins and disable_plugins return a summary dict with changed , already_enabled or already_disabled , not_found , and errors keys. Features that require knowing the current plugin state before making changes, such as strict mode, enable-one, and dry-run previews, call get_all_plugins() once at the start of the command and compute the set of changes at the script level. Plugin name matching Plugin names in the configuration file and on the command line accept either the short form ( SwitchDimension ) or the full form ( plugin-SwitchDimension ). Matching is case-insensitive. PySisense normalizes names internally, so both forms work with enable_plugins() and disable_plugins() as well. Prerequisites Python 3.10 or later Network access to the Sisense instance (the tool runs remotely and does not need to be installed on the server) A Sisense API token: Admin > REST API > v1.0 > GET /authentication/tokens/api Setup Install the required Python packages: pip install pysisense pyyaml Create a config.yaml and fill in the Sisense instance URL and API token: sisense: url: https://your-sisense-instance.com token: YOUR_API_TOKEN_HERE Add the plugins to enable to the enable_plugins list. See the Configuration reference section for all available settings. The script is then ready to run. Configuration reference sisense: url: https://your-sisense-instance.com token: YOUR_API_TOKEN_HERE # Admin → REST API → v1.0 → GET /authentication/tokens/api bulk: true # set false to update plugins one at a time instead of a single batch request # Plugins to enable. # Accepts short names (SwitchDimension) or full names (plugin-SwitchDimension). # Matching is case-insensitive. # # Default behavior: enable listed plugins; leave every other plugin unchanged. # With --strict: also disable any currently-enabled plugin NOT in this list, # making the instance exactly match this config. enable_plugins: - examplePlugin # Plugins to explicitly disable (optional). # Only needed in the default sync (no --strict), where unlisted plugins are # left alone. Listing a plugin here ensures it stays off and documents the # intentional exclusion. # disable_plugins: # - anotherExamplePlugin enable_plugins : the list of plugins to enable. By default, plugins not on this list are left in their current state. With --strict , any currently enabled plugin not on this list will be disabled. disable_plugins : optional. Plugins to explicitly disable in the default sync without --strict . Useful for documenting intentional exclusions when strict mode is not being used. bulk : controls whether plugin state changes are sent as a single batch API request or one at a time. Set to false for individual requests, which is slower but can be useful for diagnosing issues with specific plugins. Usage Run the script with no arguments to enable plugins in enable_plugins , disable plugins in disable_plugins , and leave everything else unchanged: python plugin_manager_pysisense.py Before making any changes, the script saves a timestamped snapshot of the current plugin state. To restore the most recent snapshot: python plugin_manager_pysisense.py --restore-snapshot To preview what would change without making any API calls: python plugin_manager_pysisense.py --dry-run Common use cases Maintaining a known good plugin baseline Organizations that need to ensure consistent plugin configuration across upgrades, support sessions, or environment changes can maintain an enable_plugins list in the configuration file. Running the script applies the defined configuration to the instance. To also disable any currently enabled plugin not in the list: python plugin_manager_pysisense.py --strict Testing on a stock Sisense instance Plugin interference is a common source of issues that are difficult to reproduce. To quickly disable all plugins and test against a clean instance, clear enable_plugins in the configuration file and run with --strict . The current state is saved automatically before any changes are made, and can be restored when testing is complete: # with enable_plugins cleared in config.yaml python plugin_manager_pysisense.py --strict # restore when done python plugin_manager_pysisense.py --restore-snapshot Developing and testing a single plugin When many plugins are installed, Sisense rebuilds all of them whenever any plugin changes. Using --enable-one disables all currently enabled plugins and enables only the specified plugin, which can significantly reduce rebuild time on instances with many plugins: python plugin_manager_pysisense.py --enable-one MyPlugin Snapshots The script saves snapshots as YAML files to a snapshots/ folder alongside the script. Snapshots capture the full enabled and disabled plugin state at a point in time. Snapshots are saved automatically before any run that changes state. Named snapshots can also be saved and restored explicitly: # save the current state with a specific name python plugin_manager_pysisense.py --save-snapshot before-upgrade # list all saved snapshots python plugin_manager_pysisense.py --list-snapshots # restore a specific snapshot python plugin_manager_pysisense.py --restore-snapshot before-upgrade Including --log-version when saving a snapshot records the version of each plugin at that point in time. Snapshots saved by plugin_manager_pysisense.py and plugin_manager.py are compatible. Both scripts read from the same snapshots/ directory, and each handles the other's snapshot format. Full option reference usage: plugin_manager_pysisense.py [-h] [--config FILE] [--dry-run] [--no-bulk] [--skip-snapshot] [--log-version] [--strict] [--enable-only | --disable-only] [--enable-one PLUGIN | --save-snapshot [NAME] | --list-snapshots | --restore-snapshot [NAME]] Manage Sisense plugin states via PySisense. options: -h, --help show this help message and exit --config FILE Path to config.yaml (default: config.yaml next to this script) --dry-run Preview what would change; make no API calls and save no snapshot --no-bulk Send one API call per plugin instead of a single batch PATCH. Slower but easier to diagnose partial failures. Overrides sisense.bulk in config. --skip-snapshot Do not automatically save a snapshot before this run --log-version Record each plugin's version field (from the API response) in any snapshot saved during this run --strict Also disable every currently enabled plugin that is not listed in enable_plugins. Without this flag, only plugins in disable_plugins are disabled; everything else is left alone. Always active for --restore-snapshot. --enable-only Run only the enable step; skip all disables --disable-only Run only the disable step; skip all enables --enable-one PLUGIN Enable exactly one plugin by name and disable all currently enabled others. Accepts the short or full plugin name. --save-snapshot [NAME] Save the current plugin state as a named snapshot. Omit NAME for an auto generated timestamp filename. Combine with --log-version to also record versions. --list-snapshots List all saved snapshots with creation date and enabled plugin count --restore-snapshot [NAME] Restore plugin state to exactly match a saved snapshot. Omit NAME to use the most recently created snapshot. Always strict (disables plugins not in snapshot) unless --enable-only. Plugin names accept the short form (SwitchDimension) or the full form (plugin-SwitchDimension) in both CLI args and config.yaml. Default behavior: enable plugins in enable_plugins, disable plugins in disable_plugins, leave everything else unchanged. Use --strict to also disable any enabled plugin not in enable_plugins. A snapshot is saved automatically before each run that modifies state. Use --skip-snapshot to suppress this. Use Case Managing plugins via PySisense and a configuration file offers several advantages over manual administration: Applies plugin active list consistently and repeatably without manual steps Provides automatic rollback through snapshots saved before each change Supports quickly switching between plugin states for testing or development Reduces the time required to restore a known working plugin list after an issue is resolved Demonstrates how PySisense can be used to build automation scripts for Sisense instances Summary With this tool in place, administrators and developers can manage Sisense plugin states quickly and reliably from the command line. The configuration file serves as a single source of truth for the intended plugin set, and the snapshot system ensures that any change can be reversed. The script also serves as a concrete example of how PySisense can be used in automation scripts: constructing a SisenseClient from config values, passing it to a feature class, and using the returned result dicts to drive output and error handling. The code is not compressed or obfuscated and can be modified as needed or used as a reference for similar tools. j""" plugin_manager_pysisense.py — Manage Sisense plugin states via pySisense. Same feature set as plugin_manager.py but delegates all API calls to the pySisense library instead of calling the Sisense REST API directly. Configuration is read from config.yaml. This script is also a working example of how pySisense can be used for Sisense automation. Install pySisense with: pip install pysisense Overview Manages Sisense plugin states via pySisense. Treats plugin configuration as code: define which plugins should be enabled in config.yaml, run the script, and the instance matches, quickly, from anywhere with network access. Before applying any changes, the current plugin state is automatically captured in a timestamped snapshot. If a change needs to be reverted, a single --restore-snapshot command rolls the instance back to exactly how it was. By default only the plugins explicitly listed in config.yaml are enabled or disabled, everything else is left as is. Use --strict to also disable any enabled plugin not in the list, making the instance enabled plugin list exactly match the config. Common use cases Maintain a known good plugin baseline Keep enable_plugins in config.yaml up to date. Run the script after upgrades, support sessions, or any time the instance may have drifted from the expected state. Test against a stock (no plugins) Sisense instance Clear enable_plugins in config.yaml, run --strict to disable everything, test, then restore: python plugin_manager_pysisense.py --strict python plugin_manager_pysisense.py --restore-snapshot Develop and iterate on a single plugin quickly python plugin_manager_pysisense.py --enable-one MyPlugin Roll back any change instantly python plugin_manager_pysisense.py --list-snapshots python plugin_manager_pysisense.py --restore-snapshot before-upgrade Usage # Enable listed plugins, disable listed disable_plugins, leave rest unchanged python plugin_manager_pysisense.py # Strict: also disables any enabled plugin not in enable_plugins python plugin_manager_pysisense.py --strict # Preview what would change (no API calls, no auto snapshot) python plugin_manager_pysisense.py --dry-run python plugin_manager_pysisense.py --strict --dry-run # Run only one half of the sync python plugin_manager_pysisense.py --enable-only # enable listed; skip all disables python plugin_manager_pysisense.py --disable-only # disable listed; skip all enables # Enable exactly one plugin and disable every other currently enabled plugin python plugin_manager_pysisense.py --enable-one SwitchDimension # Snapshots python plugin_manager_pysisense.py --save-snapshot [NAME] python plugin_manager_pysisense.py --save-snapshot [NAME] --log-version python plugin_manager_pysisense.py --list-snapshots python plugin_manager_pysisense.py --restore-snapshot [NAME] # omit NAME for most recent # Other flags (combinable with any of the above) --no-bulk one API call per plugin instead of a single batch request --skip-snapshot do not save an auto-snapshot before this run --log-version record each plugin's version in any snapshot saved this run --config FILE use a config file other than the default config.yaml Plugin names All plugin names accept either the short form (SwitchDimension) or the full form (plugin-SwitchDimension), both in CLI arguments and in config.yaml. Matching is case insensitive. API token Admin → REST API → v1.0 → GET /authentication/tokens/api Setup pip install pysisense pyyaml # Python 3.10+ required cp config.yaml.example config.yaml # Edit config.yaml: set sisense.url, sisense.token, and enable_plugins list """ import sys from datetime import datetime, timezone from pathlib import Path import yaml from pysisense import Plugins, SisenseClient SCRIPT_DIR = Path(__file__).parent DEFAULT_CONFIG = SCRIPT_DIR / "config.yaml" SNAPSHOTS_DIR = SCRIPT_DIR / "snapshots" # Config def load_config(path: Path) -> dict: if not path.exists(): print(f"Config file not found: {path}") print("Copy config.yaml.example to config.yaml and fill in your instance URL and API token.") sys.exit(1) with path.open() as f: return yaml.safe_load(f) def build_client(sisense_cfg: dict) -> SisenseClient: url = sisense_cfg.get("url", "") token = sisense_cfg.get("token", "") if not url or not token: print("config.yaml must include sisense.url and sisense.token.") sys.exit(1) is_ssl = not url.startswith("http://") return SisenseClient(domain=url, token=token, is_ssl=is_ssl) # Name matching — mirrors pySisense internals, used for dry-run previews and # strict-mode computation (pySisense handles matching internally for real calls) def _normalize(name: str) -> str: lower = name.lower() return lower[len("plugin-"):] if lower.startswith("plugin-") else lower def _build_lookup(names: list) -> set: lookup: set = set() for n in names: norm = _normalize(n) lookup.add(norm) lookup.add("plugin-" + norm) return lookup def _matches_lookup(plugin: dict, lookup: set) -> bool: return bool({plugin["folderName"].lower(), plugin["name"].lower()} & lookup) # Snapshot file I/O def write_snapshot_file(name: str, snapshot: dict) -> Path: SNAPSHOTS_DIR.mkdir(exist_ok=True) path = SNAPSHOTS_DIR / f"{name}.yaml" with path.open("w") as f: yaml.dump(snapshot, f, sort_keys=False, default_flow_style=False, allow_unicode=True) return path def read_snapshot_file(name: str) -> dict: path = SNAPSHOTS_DIR / f"{name}.yaml" if not path.exists(): print(f"Snapshot not found: {path}") sys.exit(1) with path.open() as f: data = yaml.safe_load(f) # Translate 'enable_plugins' key (plugin_manager.py snapshot format) to 'plugins' if "enable_plugins" in data and "plugins" not in data: data["plugins"] = data["enable_plugins"] return data def list_snapshot_files() -> list: if not SNAPSHOTS_DIR.exists(): return [] return sorted(SNAPSHOTS_DIR.glob("*.yaml")) def latest_snapshot_name() -> str: files = list_snapshot_files() if not files: print("No snapshots found.") sys.exit(1) def created_at(path: Path) -> str: with path.open() as f: return yaml.safe_load(f).get("created", "") return max(files, key=created_at).stem def _auto_save_snapshot(all_plugins: list, include_version: bool) -> None: name = datetime.now().strftime("auto_%Y%m%d_%H%M%S") print(f"\nSaving snapshot '{name}' before applying changes...") try: enabled = sorted(p["folderName"] for p in all_plugins if p.get("isEnabled")) disabled = sorted(p["folderName"] for p in all_plugins if not p.get("isEnabled")) snapshot: dict = { "plugins": enabled, "created": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"), } if include_version: versions: dict = {} for p in all_plugins: v = p.get("version") or p.get("pluginVersion") if v: versions[p["folderName"]] = str(v) if versions: snapshot["plugin_versions"] = versions path = write_snapshot_file(name, snapshot) print(f" Saved to {path} ({len(enabled)} enabled / {len(disabled)} disabled)") except Exception as exc: print(f" Warning: auto snapshot failed: {exc}") # Sync computation — determines which plugins need their state changed. # Used for dry-run previews, strict mode, and enable-one. def _compute_updates( all_plugins: list, enable_names: list, disable_names: list, *, strict: bool, enable_only: bool, disable_only: bool, ) -> tuple: enable_lookup = _build_lookup(enable_names) disable_lookup = _build_lookup(disable_names) matched_enable = [p for p in all_plugins if _matches_lookup(p, enable_lookup)] enable_folder_set = {p["folderName"] for p in matched_enable} to_enable: list = [] if disable_only else sorted( p["folderName"] for p in matched_enable if not p.get("isEnabled") ) if enable_only: to_disable: list = [] elif strict: to_disable = sorted( p["folderName"] for p in all_plugins if p.get("isEnabled") and p["folderName"] not in enable_folder_set ) else: to_disable = sorted( p["folderName"] for p in all_plugins if p.get("isEnabled") and _matches_lookup(p, disable_lookup) ) matched_norms = ( {_normalize(p["folderName"]) for p in matched_enable} | {_normalize(p["name"]) for p in matched_enable} ) unmatched = sorted(n for n in enable_names if _normalize(n) not in matched_norms) return to_enable, to_disable, unmatched # Output helpers def _print_update_plan( to_enable: list, to_disable: list, already_correct: int, untouched: int = 0, ) -> None: print(f" To enable: {len(to_enable)}") print(f" To disable: {len(to_disable)}") if already_correct > 0: print(f" Already set: {already_correct}") if untouched > 0: print(f" Untouched: {untouched} (not listed in config; left as-is)") print() def _print_dry_run_preview(to_enable: list, to_disable: list) -> None: if not to_enable and not to_disable: print("Nothing to change.") if to_enable: print("Would enable:") for f in to_enable: print(f" + {f}") if to_disable: print("Would disable:") for f in to_disable: print(f" - {f}") print("\n[DRY RUN] No changes made.") def _report_unmatched(unmatched: list) -> None: if unmatched: print(f"\nNot found in instance ({len(unmatched)}):") for n in unmatched: print(f" - {n}") def _apply_enable(plugins_obj: Plugins, to_enable: list, bulk: bool) -> int: if not to_enable: return 0 result = plugins_obj.enable_plugins(to_enable, bulk=bulk) if "error" in result: print(f"Failed to enable plugins: {result['error']}") sys.exit(1) for f in result["changed"]: print(f" [ENABLED] {f}") return len(result.get("errors", [])) def _apply_disable(plugins_obj: Plugins, to_disable: list, bulk: bool) -> int: if not to_disable: return 0 result = plugins_obj.disable_plugins(to_disable, bulk=bulk) if "error" in result: print(f"Failed to disable plugins: {result['error']}") sys.exit(1) for f in result["changed"]: print(f" [DISABLED] {f}") return len(result.get("errors", [])) # Commands def cmd_sync_to_config( plugins_obj: Plugins, enable_names: list, disable_names: list, *, dry_run: bool, bulk: bool, strict: bool, enable_only: bool, disable_only: bool, skip_snapshot: bool, include_version: bool, ) -> None: print("Fetching plugin list...") all_plugins = plugins_obj.get_all_plugins() if all_plugins and "error" in all_plugins[0]: print(f"Failed to fetch plugins: {all_plugins[0]['error']}") sys.exit(1) print(f" {len(all_plugins)} plugins total\n") to_enable, to_disable, unmatched = _compute_updates( all_plugins, enable_names, disable_names, strict=strict, enable_only=enable_only, disable_only=disable_only, ) enable_lookup = _build_lookup(enable_names) disable_lookup = _build_lookup(disable_names) matched = [p for p in all_plugins if _matches_lookup(p, enable_lookup)] already_correct = sum(1 for p in matched if p.get("isEnabled")) untouched = 0 if strict or enable_only else sum( 1 for p in all_plugins if not _matches_lookup(p, enable_lookup) and not _matches_lookup(p, disable_lookup) ) if matched: print(f"Matched {len(matched)} plugin(s) from enable_plugins:\n") print(f" {'Folder name':<45} {'API name':<35} {'Enabled'}") print(f" {'-'*45} {'-'*35} {'-'*7}") for p in sorted(matched, key=lambda x: x["folderName"]): print(f" {p['folderName']:<45} {p['name']:<35} {p['isEnabled']}") print() _print_update_plan(to_enable, to_disable, already_correct, untouched) if dry_run: _print_dry_run_preview(to_enable, to_disable) _report_unmatched(unmatched) return if not skip_snapshot and (to_enable or to_disable): _auto_save_snapshot(all_plugins, include_version) errors = _apply_disable(plugins_obj, to_disable, bulk) + _apply_enable(plugins_obj, to_enable, bulk) if not to_enable and not to_disable: print("Nothing to change.") else: print(f"\nDone. Enabled: {len(to_enable)} Disabled: {len(to_disable)} Errors: {errors}") _report_unmatched(unmatched) def cmd_enable_one( plugins_obj: Plugins, plugin_name: str, *, dry_run: bool, bulk: bool, skip_snapshot: bool, include_version: bool, ) -> None: target_lookup = _build_lookup([plugin_name]) print("Fetching plugin list...") all_plugins = plugins_obj.get_all_plugins() if all_plugins and "error" in all_plugins[0]: print(f"Failed to fetch plugins: {all_plugins[0]['error']}") sys.exit(1) print(f" {len(all_plugins)} plugins total\n") target = next((p for p in all_plugins if _matches_lookup(p, target_lookup)), None) if target is None: print(f"Plugin not found: {plugin_name!r}") print("Tip: check spelling against the Sisense admin panel, or run --save-snapshot to capture current names.") sys.exit(1) target_folder = target["folderName"] target_on = target.get("isEnabled", False) to_enable = [] if target_on else [target_folder] to_disable = sorted( p["folderName"] for p in all_plugins if p.get("isEnabled") and p["folderName"] != target_folder ) print(f"Target plugin: {target_folder}") print(f" Currently: {'enabled' if target_on else 'disabled'}\n") _print_update_plan(to_enable, to_disable, already_correct=1 if target_on else 0) if dry_run: _print_dry_run_preview(to_enable, to_disable) return if not skip_snapshot and (to_enable or to_disable): _auto_save_snapshot(all_plugins, include_version) errors = _apply_disable(plugins_obj, to_disable, bulk) + _apply_enable(plugins_obj, to_enable, bulk) if not to_enable and not to_disable: print("Nothing to change.") else: print(f"\nDone. Enabled: {len(to_enable)} Disabled: {len(to_disable)} Errors: {errors}") def cmd_save_named_snapshot(plugins_obj: Plugins, name: str, include_version: bool) -> None: print("Fetching plugin list...") all_plugins = plugins_obj.get_all_plugins() if all_plugins and "error" in all_plugins[0]: print(f"Failed to fetch plugins: {all_plugins[0]['error']}") sys.exit(1) print(f" {len(all_plugins)} plugins total\n") enabled = sorted(p["folderName"] for p in all_plugins if p.get("isEnabled")) disabled = sorted(p["folderName"] for p in all_plugins if not p.get("isEnabled")) snapshot: dict = { "plugins": enabled, "created": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"), } if include_version: versions: dict = {} for p in all_plugins: v = p.get("version") or p.get("pluginVersion") if v: versions[p["folderName"]] = str(v) if versions: snapshot["plugin_versions"] = versions path = write_snapshot_file(name, snapshot) print(f"Snapshot '{name}' saved to {path}") print(f" {len(enabled)} enabled / {len(disabled)} disabled plugin(s) captured.") if include_version and snapshot.get("plugin_versions"): print(f" Versions recorded for {len(snapshot['plugin_versions'])} plugin(s).") def cmd_list_snapshots() -> None: files = list_snapshot_files() if not files: print("No snapshots found.") return print(f"Snapshots ({len(files)}):\n") print(f" {'Name':<32} {'Created':<22} {'Enabled':<9} {'Versions'}") print(f" {'-'*32} {'-'*22} {'-'*9} {'-'*8}") for path in files: with path.open() as f: data = yaml.safe_load(f) enabled_count = len(data.get("plugins") or data.get("enable_plugins", [])) versions_logged = "yes" if data.get("plugin_versions") else "no" print( f" {path.stem:<32} " f"{data.get('created', 'unknown'):<22} " f"{enabled_count:<9} " f"{versions_logged}" ) def cmd_restore_snapshot( plugins_obj: Plugins, name: str, *, dry_run: bool, bulk: bool, enable_only: bool, disable_only: bool, skip_snapshot: bool, include_version: bool, ) -> None: snapshot = read_snapshot_file(name) snapshot_plugins = set(snapshot.get("plugins", [])) print(f"Snapshot '{name}' ({snapshot.get('created', 'unknown')})") print(f" {len(snapshot_plugins)} plugin(s) enabled in snapshot") if snapshot.get("plugin_versions"): print(f" Plugin versions recorded: {len(snapshot['plugin_versions'])}") print() print("Fetching plugin list...") all_plugins = plugins_obj.get_all_plugins() if all_plugins and "error" in all_plugins[0]: print(f"Failed to fetch plugins: {all_plugins[0]['error']}") sys.exit(1) print(f" {len(all_plugins)} plugins total\n") by_folder = {p["folderName"]: p for p in all_plugins} to_enable: list = [] if disable_only else sorted( f for f in snapshot_plugins if f in by_folder and not by_folder[f].get("isEnabled") ) to_disable: list = [] if enable_only else sorted( p["folderName"] for p in all_plugins if p.get("isEnabled") and p["folderName"] not in snapshot_plugins ) not_in_instance = sorted(f for f in snapshot_plugins if f not in by_folder) already_correct = max(0, len(snapshot_plugins) - len(to_enable) - len(not_in_instance)) _print_update_plan(to_enable, to_disable, already_correct) if dry_run: _print_dry_run_preview(to_enable, to_disable) if not_in_instance: print(f"\nNot found in instance ({len(not_in_instance)}):") for f in not_in_instance: print(f" - {f}") return if not skip_snapshot and (to_enable or to_disable): _auto_save_snapshot(all_plugins, include_version) errors = _apply_disable(plugins_obj, to_disable, bulk) + _apply_enable(plugins_obj, to_enable, bulk) if not to_enable and not to_disable: print("Nothing to change.") else: print(f"\nDone. Enabled: {len(to_enable)} Disabled: {len(to_disable)} Errors: {errors}") if not_in_instance: print(f"\nNot found in instance ({len(not_in_instance)}):") for f in not_in_instance: print(f" - {f}") # Main def main() -> None: import argparse parser = argparse.ArgumentParser( prog="plugin_manager_pysisense.py", description="Manage Sisense plugin states via pySisense.", formatter_class=argparse.RawDescriptionHelpFormatter, epilog=( "Plugin names accept the short form (SwitchDimension) or the full\n" "form (plugin-SwitchDimension) in both CLI args and config.yaml.\n" "\n" "Default behavior: enable plugins in enable_plugins, disable plugins\n" "in disable_plugins, leave everything else unchanged.\n" "Use --strict to also disable any enabled plugin not in enable_plugins.\n" "\n" "A snapshot is saved automatically before each run that\n" "modifies state. Use --skip-snapshot to suppress this." ), ) parser.add_argument( "--config", default=str(DEFAULT_CONFIG), metavar="FILE", help="Path to config.yaml (default: config.yaml next to this script)", ) parser.add_argument( "--dry-run", action="store_true", help="Preview what would change; make no API calls and save no snapshot", ) parser.add_argument( "--no-bulk", action="store_true", help=( "Send one API call per plugin instead of a single batch PATCH. " "Slower but easier to diagnose partial failures. " "Overrides sisense.bulk in config." ), ) parser.add_argument( "--skip-snapshot", action="store_true", help="Do not automatically save a snapshot before this run", ) parser.add_argument( "--log-version", action="store_true", help=( "Record each plugin's version field (from the API response) in any " "snapshot saved during this run (manual --save-snapshot or auto saved snapshot)" ), ) parser.add_argument( "--strict", action="store_true", help=( "Also disable every currently enabled plugin that is not listed in " "enable_plugins. Without this flag, only plugins in disable_plugins are " "disabled; everything else is left alone. " "Always active for --restore-snapshot." ), ) direction_group = parser.add_mutually_exclusive_group() direction_group.add_argument( "--enable-only", action="store_true", help="Run only the enable step; skip all disables", ) direction_group.add_argument( "--disable-only", action="store_true", help="Run only the disable step; skip all enables", ) mode_group = parser.add_mutually_exclusive_group() mode_group.add_argument( "--enable-one", metavar="PLUGIN", help=( "Enable exactly one plugin by name and disable all currently enabled " "others. Accepts the short or full plugin name." ), ) mode_group.add_argument( "--save-snapshot", metavar="NAME", nargs="?", const="__auto__", help=( "Save the current plugin state as a named snapshot. " "Omit NAME for an auto generated timestamp filename. " "Combine with --log-version to also record versions for each plugin." ), ) mode_group.add_argument( "--list-snapshots", action="store_true", help="List all saved snapshots with creation date and enabled plugin count", ) mode_group.add_argument( "--restore-snapshot", metavar="NAME", nargs="?", const="__latest__", help=( "Restore plugin state to exactly match a saved snapshot. " "Omit NAME to use the most recently created snapshot. " "Always strict (disables plugins not in snapshot) unless --enable-only." ), ) args = parser.parse_args() if args.list_snapshots: cmd_list_snapshots() return cfg = load_config(Path(args.config)) sisense_cfg = cfg.get("sisense", {}) bulk = sisense_cfg.get("bulk", True) and not args.no_bulk client = build_client(sisense_cfg) plugins_obj = Plugins(api_client=client) if args.enable_one: cmd_enable_one( plugins_obj, args.enable_one, dry_run=args.dry_run, bulk=bulk, skip_snapshot=args.skip_snapshot, include_version=args.log_version, ) elif args.save_snapshot is not None: name = ( datetime.now().strftime("snapshot_%Y%m%d_%H%M%S") if args.save_snapshot == "__auto__" else args.save_snapshot ) cmd_save_named_snapshot(plugins_obj, name, args.log_version) elif args.restore_snapshot is not None: name = ( latest_snapshot_name() if args.restore_snapshot == "__latest__" else args.restore_snapshot ) cmd_restore_snapshot( plugins_obj, name, dry_run=args.dry_run, bulk=bulk, enable_only=args.enable_only, disable_only=args.disable_only, skip_snapshot=args.skip_snapshot, include_version=args.log_version, ) else: enable_names = cfg.get("enable_plugins") or cfg.get("plugins", []) disable_names = cfg.get("disable_plugins", []) if not enable_names and not disable_names: print("config.yaml must include at least one entry in 'enable_plugins'.") sys.exit(1) cmd_sync_to_config( plugins_obj, enable_names, disable_names, dry_run=args.dry_run, bulk=bulk, strict=args.strict, enable_only=args.enable_only, disable_only=args.disable_only, skip_snapshot=args.skip_snapshot, include_version=args.log_version, ) if __name__ == "__main__": main() 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.

    Jeremy Friedel
    Jeremy Friedel
    1
             
…