Can you add an 'Export' Button in App?
I have a Pivot Table Card that the end users would like to export to excel or pdf. In order to do that they would need to Expand the Card → Card Options → Export → Export Options.
Is there any way that I can add a Button 'Export' in App and take the users to Export Options if they click on it?
Best Answer
-
I don't think there is a direct way to programmatically add a custom button inside a pivot card to trigger an export. But you can probably do something similar through a custom card or app.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1
Answers
-
I don't think there is a direct way to programmatically add a custom button inside a pivot card to trigger an export. But you can probably do something similar through a custom card or app.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1 -
It's funny, on an embedded app, you can "allow export" which surfaces the Export button to be right next to the "expand for detailed view" button, which is way easier to find for users. It would be nice if this was possible in an AppStudio app that was shared directly in Domo.
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
2 -
@ArborRose How would I be able to achieve it through custom card/ App?
1 -
@art_in_sky - I haven't done this for anything myself. I'd have to work through it. I would probably try to leverage the Domo Embed API. Embed the card in an iframe and add an export button to append ?export=true.
domo.get(`/v1/cards/{CARD_ID}`)
.then((card) => {
const iframe = document.createElement('iframe');
iframe.src = card.embedUrl;
iframe.width = '100%';
iframe.height = '600px';
document.getElementById('pivotCardContainer').appendChild(iframe);
document.getElementById('exportButton').addEventListener('click', () => {
window.open(`${card.embedUrl}?export=true`);
});
})
.catch((error) => {
console.error('Error embedding card:', error);
});Or try to access the dataset using Domo's API.
document.getElementById('exportButton').addEventListener('click', async () => {
const datasetId = 'YOUR_DATASET_ID';
const response = await domo.get(`/v1/datasets/${datasetId}/data`);
const data = response.data;
// Use SheetJS or other tools to generate a file
const workbook = XLSX.utils.book_new();
const worksheet = XLSX.utils.json_to_sheet(data);
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
XLSX.writeFile(workbook, 'export.xlsx');
});But a quick search on the web pulls some other conversations where it looks like maybe someone has already suggested a way.
** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **1
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
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 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