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.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.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive