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.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive