Automatically Change Widget Title Based on Filter (Linux)
Summary: Liliia Kislitsyna, Liliia Kislitsyna, provides a detailed guide on dynamically changing widget titles based on active filter values in Sisense dashboards, using custom scripting. The steps outlined involve modifying a widget's script to adjust its title according to filter selections, enhancing contextual relevance. jameshaid, jameshaid, responds with a query regarding its applicability with Sisense Cloud version 2026.1.0-d, mentioning a lack of impact when modifying the script for a specific dashboard filter. James changed "Name" to "Time Period" but noted no effect, expressing interest in a solution to emphasize the selected Time Period more effectively on the widget titles.
widget.on("render", function () {
let title = "name(s) selected";
// Find the "Name" filter
let filterUsed = dashboard.filters.$$items.find(
(filter) => filter.jaql.title === "Name"
);
// Get selected Name values or set default "No" text
let filterText =
filterUsed && filterUsed.jaql.filter.members?.length
? filterUsed.jaql.filter.members.join(", ")
: "No";
let isModified = false;
if (!isModified) {
widget.title = filterText + ' ' + title;
isModified = true;
}
});4. Adjust the column name under "Name" and any default text as necessary to fit your specific use case and data structure.
5. After adding the script, refresh the dashboard.
6. Validate that the widget title changes dynamically based on the current filter selection.
7. Ensure the column name in the script matches the actual filter setup.
8. Confirm that the script editor is appropriately saved and applied to the widget.
Conclusion
By following the steps outlined above, you can efficiently update widget titles to reflect filter changes, improving data navigation and user engagement on your Sisense dashboards. While this feature isn't supported natively, custom scripting provides a viable workaround for dynamic title adjustments.
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.
James Haid
·6 months agoShould this work with Sisense Cloud version 2026.1.0-d? I'd like to determine if I'm implementing this solution wrong or if the disclaimer does apply to my Sisense version. It's a perfect solution for our embedded users.
Instructions are straightforward, and I only changed "Name" on line 5 to "Time Period" to align with my dashboard filter. No other changes were made to the script. Unfortunately, there was no impact to the widget's Title.
I'd like to implement this, or a very similar solution, since several charts are dependent upon the Time Period filter, and the selected Time Period needs to be emphasized more than just existing in the dashboard filter column.