How we can limit the number of rows in api call
Hi,
I am trying to access data of dataset using api and fetched the data using below api.
https://api.domo.com/v1/datasets/{DATASET_ID}/data
But it provide all the data, How we can limit the number of rows in api call?
Please provide us the link if have any.
Comments
-
You can potentially leverage the column filter options as listed at the top of this page, but it doesn't explicitly state the number of rows that you can retrieve:
https://developer.domo.com/docs/dataset-api-reference/dataset#Export%20data%20from%20DataSet
I don't think they offer the capability to limit the row return count just yet though for the Dataset API.
0 -
You can user the "query a dataset" version of the dataset API. It works great for aggregating data, even from large datasets. here is a powershell example of the query:
$query = '{"sql": "select sum(gross_sales_less_returns) from table where fiscal_date = '+"'" +$Yesterday +"'::DATE group by fiscal_date"+'"}'
The call then looks like this:
$data = Invoke-RestMethod -Method POST -Uri "https://api.domo.com/v1/datasets/query/execute/$datasetId" -body $query -Headers $headers -ContentType 'application/json;charset=UTF-8'
I check the amount of yesterday's sales in case something broke upstream and my dataset updated with nothing from yesterday before sending out reports.
Hope that helps.
William
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
- 682 Automate
- 175 Apps
- 451 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