Redirect users to different dashboards based on dashboard filters
This article discusses and shares the full code of a dashboard script that redirects users to a different dashboard ID based on the user's filter selections or initial loaded filter state. In the particular example shared in this article, the script checks whether the selected date filter (either from a members filter or a from/to filter range) includes an earlier date than the earliest date in the current dashboard's datasource. If this is the case, the script redirects the user to a specified alternate dashboard, preserving any additional URL segments and query parameters in the URL. Any other type of filter state can also be used to determine on when the script should redirect, including non-date filters using similar scripts.441Views1like0CommentsEmbedding a Google Doc or Sheet in Your Dashboard
The iFrame Widget Plugin is a powerful tool that enables you to embed any web page that you wish into your dashboard, using its URL. A great use of the iFrame widget can also be used to Embed Google Docs or Sheets. The quick access to the document or sheet can be used to store notes and comments derived from a dashboard's results. Furthermore, it can be utilized for reading or even updating the same spreadsheet being used as an Elasticube's data source (write back). Other users with whom the dashboard is shared will be able to view the content of the doc, only if its sharing settings allow it. You can decide if the user must be logged in to Google, and if so, who may view and who may edit. For more information about it, see this Google article. To embed a single fixed doc: 1. Get the required doc's URL. If you want the doc to be editable, use the shareable URL. If you want it to be presented in presentation only mode, use the Published URL. 2. Create a new iFrame widget. 3. In the Widget's edit mode, provide the document's URL to the iFrame. 4. Apply your changes. To Embed a dynamic, filter responsive selection of documents: 1. Create a table that would list all of the relevant documents' description and URL. In the below example, we are using the owner's Email as the description that we will filter by: 2. Import the table into an existing or to a new Elasticube. The table can exist as a stand-alone island, and enable filtering based on its inline dimensions, or it can be integrating into an existing model, to enable interaction with its additional filters. 3. Create a new iFrame widget based on the same cube. In the widget's URL panel, add the field that holds the documents' URLs 4. Apply changes and inspect your dashboard. You can now choose the required document by choosing the relevant Email:6.7KViews0likes0CommentsDynamic Resize For Embedded IFrames
If you've ever attempted to dynamically resize your embedded iFrames in your parent application, you may have experienced a CORS conflict. Basically, since your parent application and sisense application serve from different domains, your browser restricts HTTP responses for security reasons. Luckily, we have a workaround that leverages the Window.postMessage() function. This solution dynamically resizes your embedded iFrame based on the height of the contents. // Within your SISENSE APPLICATION, apply this script on the dashboard to be embedded via iFrame: dashboard.on('refreshend', function () { var heightValue = 0, columnArr = dashboard.layout.columns, columnHeight = [], targetWindow = window.parent, // replace with your target domain targetOrigin = 'http://main.mytestapp.com:8083'; // iterate through columns for (var i = 0; i < columnArr.length; i++) { var cellsLength = columnArr[i].cells.length, heightTotal = 0; // increment through each column widget for (var j = 0; j < cellsLength; j++) { var height = columnArr[i].cells[j].subcells[0].elements[0].height; heightTotal += height; } columnHeight.push(heightTotal); // assign max aggregate column height heightValue = columnHeight.reduce(function (a, b) { return Math.max(a, b); }); } targetWindow.postMessage({ heightValue: heightValue }, targetOrigin); }); // Within your PARENT APPLICATION: window.addEventListener('message', receiveMessage, false); function receiveMessage(event) { // replace with your sisense application origin var sendingOrigin = 'http://reporting.mytestapp.com:8080'; if (event.origin !== sendingOrigin) { throw new Error('bad origin:', event.origin); } else { try { // replace with your iFrame ID document.getElementById('ifm').height = event.data.heightValue; } catch (err) { throw new Error(err.name + ':', err.message); } } }2.4KViews2likes1CommentSync Blox Input Element with Current Filter State
When creating a Blox widget altering a filter within a dashboard or widget, it is sometimes advantageous to modify the default behavior, that upon activating a Blox action , the Blox widget input or inputs retain the recently entered values instead of reverting to the default Blox inputs set in the Blox template. Additionally, when a user has the permission to directly modify the relevant filter, bypassing Blox widget actions, and subsequently makes changes to the filter that the Blox widget is designed to manipulate, the default Blox input values may no longer match with the current state of the filter.970Views1like0CommentsAnimating Sisense Title Elements and Widgets Using CSS Animations
Animating Sisense widget elements and dashboard and widget titles is a possible way to enhance the visual appeal and user experience of a Sisense dashboard, or highlight a particular part of a dashboard or widget. Sisense widgets and titles are standard HTML elements, making it possible to apply animation using solely standard CSS stylesheets, much like other HTML elements on non-Sisense pages. Animations can include effects like fading widgets in or out and cyclic changes in text color of widgets or titles.1.5KViews1like0Comments