Blox Date Filters with Different Granularity - Custom Action Code Snippet
let itemArr = prism.activeDashboard.filters.$$items;
let OurFilter = itemArr.find(function (x) {
return x.jaql && x.jaql.title === payload.data.filters[0].filterName
});
OurFilter.jaql.level = payload.data.level;
OurFilter.jaql.filter = payload.data.filters[0].filterJaql;
payload.widget.dashboard.filters.update(OurFilter, { save: true, refresh: true });
- And press "Create":
- Ensure the custom action correctly maps each button to its respective time period level (e.g., days, months, quarters, years).
4. Testing the Solution:
- Test the buttons to ensure they change the time period as expected.
- Verify that the custom action works without requiring multiple clicks.
Troubleshooting Tips
- If the buttons still do not work as expected, double-check the custom action settings in the Blox editor.
- Ensure that the dashboard filters are correctly linked to the custom actions.
Supplementary Information
- For further assistance, contact Sisense support or refer to the Sisense community forums for additional insights and shared solutions.
Disclaimer: Please note that this blog post contains one possible custom workaround solution for users with similar use cases. We cannot guarantee that the custom code solution described in this post will work in every scenario or with every Sisense software version. As such, we strongly advise users to test solutions in their environment prior to deploying them to ensure that the solutions proffered function as desired in their environment. For the avoidance of doubt, the content of this blog post is provided to you "as-is" and without warranty of any kind, express, implied, or otherwise, including without limitation any warranty of security and or fitness for a particular purpose. The workaround solution described in this post incorporates custom coding, which is outside the Sisense product development environment and is, therefore, not covered by Sisense warranty and support services.
DRay
·1 year agoWant to learn more about how to use Blox? You're in luck! We have Blox tutorials here, https://docs.sisense.com/main/SisenseLinux/sisense-blox-tutorials.htm, and here, https://academy.sisense.com/blox-lite-version