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
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 731 Beast Mode
- 55 App Studio
- 40 Variables
- 683 Automate
- 175 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 122 Manage
- 119 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive