Programmatic Filters Implementation Help
Hi, I'm using programmatic filters for the first time. This image below is on Domo's documentation -
. I created a similar file in my code base but I'm not sure what visualization1 is? Is it the name of the dashbord? Where is it defined? Additionally, how is this called in the frontend? Do I need to do anything on the frontend for this to work, for eg: any fields in the iframe tag?Best Answer
-
@ekishab, thanks for your question!
Context:
With programmatic filters and dashboard / card embed, your web page will have a dashboard / cards embedded into it by way of an iFrame.
Depending on who is logged into your Web portal / page they may see a sales dashboard / card in the first iFrame and an marketing dashboard / card in a second iFrame - each of the dashboards in DOMO will have it's own associated Embed ID.
For user Mike - viz 1 may be the Sales with its own set of filters and viz 2 the marketing with its own set of filters.
For user Suzanne viz 1 may be the Sales with a different set of filters to Mike and viz 2 the marketing with its own set of filters.
etc.
Code
Looking at the sample.html that came with the code:
<iframe id="iframe1" src="/embed/items/1" width="100%" height="100%" scrolling="no" style="border: none"></iframe>
The source is pointing to the first vizualization in the Users.js file for this user (item/1).
This is handled in the express.js file with the Item/1 passed in from the iFrame:
app.get('/embed/items/:itemId', passport.authenticationMiddleware(), (req, res, next) => { const config = req.user.config['visualization'+req.params.itemId]; if (config.embedId) { embed.handleRequest(req, res, next, req.user.config['visualization'+req.params.itemId]); } else { next(`The EMBED_ID${req.params.itemId} environment variable in your .env file is not set. Please set this in order to view content here.`); }});
Conclusion
For mike, the iFrame will return the Sales dashboard / card with a set of filters applied.
For Suzanne, the Sales dashboard / card will be returned with a different set of filters applied.
You need to ensure that the Users.js file is populated with the correct embed Ids, filters & credentials for the iFrame to be able to retreive the correct visulization for the specific user.
1
Answers
-
@ekishab, thanks for your question!
Context:
With programmatic filters and dashboard / card embed, your web page will have a dashboard / cards embedded into it by way of an iFrame.
Depending on who is logged into your Web portal / page they may see a sales dashboard / card in the first iFrame and an marketing dashboard / card in a second iFrame - each of the dashboards in DOMO will have it's own associated Embed ID.
For user Mike - viz 1 may be the Sales with its own set of filters and viz 2 the marketing with its own set of filters.
For user Suzanne viz 1 may be the Sales with a different set of filters to Mike and viz 2 the marketing with its own set of filters.
etc.
Code
Looking at the sample.html that came with the code:
<iframe id="iframe1" src="/embed/items/1" width="100%" height="100%" scrolling="no" style="border: none"></iframe>
The source is pointing to the first vizualization in the Users.js file for this user (item/1).
This is handled in the express.js file with the Item/1 passed in from the iFrame:
app.get('/embed/items/:itemId', passport.authenticationMiddleware(), (req, res, next) => { const config = req.user.config['visualization'+req.params.itemId]; if (config.embedId) { embed.handleRequest(req, res, next, req.user.config['visualization'+req.params.itemId]); } else { next(`The EMBED_ID${req.params.itemId} environment variable in your .env file is not set. Please set this in order to view content here.`); }});
Conclusion
For mike, the iFrame will return the Sales dashboard / card with a set of filters applied.
For Suzanne, the Sales dashboard / card will be returned with a different set of filters applied.
You need to ensure that the Users.js file is populated with the correct embed Ids, filters & credentials for the iFrame to be able to retreive the correct visulization for the specific user.
1
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 295 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 97 SQL DataFlows
- 608 Datasets
- 2.1K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 712 Beast Mode
- 50 App Studio
- 39 Variables
- 668 Automate
- 170 Apps
- 446 APIs & Domo Developer
- 45 Workflows
- 7 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 391 Distribute
- 111 Domo Everywhere
- 274 Scheduled Reports
- 6 Software Integrations
- 116 Manage
- 113 Governance & Security
- Domo Community Gallery
- 31 Product Releases
- 9 Domo University
- 5.3K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 104 Community Announcements
- 4.8K Archive