DDX Bricks: domo.onFiltersUpdate () and impact on page filters
Hello Domo Community,
I am seeking assistance with an issue I am encountering while using the domo.onFiltersUpdate()
method in my Domo app. My goal is to make my app reactive to page filters, ensuring that the data and visualization are updated accordingly when filters are applied or changed on the page.
Issue:While the domo.onFiltersUpdate()
method allows me to listen for filter updates and re-fetch data accordingly, it seems to prevent the default refresh behavior of the app. This is problematic because I need the app to refresh when page filters are applied.
Question:
- How can I ensure that my app still respects the page filters and refreshes the data and visualization accordingly when using
domo.onFiltersUpdate()
? - Is there a way to manually trigger a refresh or handle the filters in such a way that it mimics the default behavior while still allowing for custom handling?
Any insights, suggestions, or examples of how others have tackled similar issues would be greatly appreciated. Thank you in advance for your help!
Best Answer
-
I would think that filtering would limit the incoming dataset before any of the brick code occurs. From that point, it would be up to your code in JavaScript to deal with the changes. Order of processing. It seems like you are trying to put a condition on the code that might be trying to put back data that isn't there at the time of your event.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0
Answers
-
If your brick dataset is on dashboard with filters against the same dataset, it should filter on its own. Filters must have the same field name. And Javascript is case sensitive..make sure you type the field names exactly the same.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Thanks for your response! I suspected the same, but when I include this function, the natural page filtering stops working. For context, I'm using the Hierarchy Org DDX Brick from the Apps section and enhancing its functionality. My goal is to enable automatic expansion to the child nodes based on what filter is used or last used. However, this enhancement is causing the page filtering to fail.
function updateExpansionLevel(filters) {
let expandLevel = '0';
const filterColumns = filters.map(f => f.column);
if (filterColumns.includes('Filter3')) {
expandLevel = '3';
} else if (filterColumns.includes('Filter2')) {
expandLevel = '2';
} else if (filterColumns.includes('Filter1')) {
expandLevel = '1';
}
expandByRank(expandLevel);
}
// Listen for filter updates
domo.onFiltersUpdate(filters => {
updateExpansionLevel(filters);
});Thanks!
h
0 -
I would think that filtering would limit the incoming dataset before any of the brick code occurs. From that point, it would be up to your code in JavaScript to deal with the changes. Order of processing. It seems like you are trying to put a condition on the code that might be trying to put back data that isn't there at the time of your event.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 297 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 678 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive