Automatically export Dataset from Domo
Comments
-
I would recommend using the API to do this, it will require the following.
1: Script that pulls down the data of a specific dataset into a CSV (all doable with the API/SDK. I've done this in Python).
2: Once the file is downloaded the script would send it via email
3: A way to run the script on a schedule so that you can have it run daily.
This seems to me to be the most basic way you can do this. You would be able to re-use almost all the code for any dataset you want to do this for, you would just swap out the dataset ID to get different datasets.
Here is some example Python code from a script I made to do this, it'll get you started (if you do it in Python)
import json
import requests
import datetime
# Base64 version of combined id+secret
base64auth = {InsertYourBase64Auth}
api_host = 'api.domo.com'
# Get token from Domo
token = requests.get('https://api.domo.com/oauth/token?grant_type=client_credentials&scope=audit data', headers={'Authorization': 'Basic ' + base64auth})
token = json.loads(token.text)
token = token['access_token']
dataset_id ={EnterYourDatasetId}
csv_file_path = 'C:\\Users\\{UserAccount}\\PycharmProjects\\DomoScripts\\files\\jira-data.csv'
# GET request for the dataset list data
dataset_endpoint = "https://api.domo.com/v1/datasets/"+ dataset_id + "/data?includeHeader=true&fileName=jira-data.csv"
dataset_response = requests.get(dataset_endpoint, headers={'Accept': 'text/csv','Authorization': 'bearer ' + token})
with open(csv_file_path,'wb') as csv_file:
for chunk in dataset_response.iter_content(chunk_size=1024):
if chunk:
csv_file.write(chunk)
csv_file.close()
**Make sure to like any users posts that helped you and accept the ones who solved your issue.**1 -
This is not helpful because the card is a pivot table, and I don't think a CSV would keep the pivot, and certainly would not keep the conditional formatting.
It is maddening that the reports and publish only do a jpg of what fits on one page, while the export to xls is exactly the format I would like to send out as an automated report.
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
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 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
- 123 Manage
- 120 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