Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
bob57
Helper IV
Helper IV

Getting Data From Toggle Time Tracker and Pagination

Hello,

I've been tasked with getting all time entries from Toggle into Power Bi. Problem: Only 50 records are returned. Does anyone have experience with this and know how to retrieve all records? Or is there another preferred method? Below is the query and a link to the API documentation.

Thank you,

Bob

 

API Doc: https://developers.track.toggl.com/docs/

 

let
baseUrl = "https://api.track.toggl.com/",
// the token part can vary depending on the requisites of the API
accessToken = "Basic Mzg2MzQ1NGFlZGU3Nzg3YWE5MzE0ZjU0ZGU4NmRkNjk6YXBpX3Rva2Vu",
postData = Json.FromValue([start_date = #date(2023,1,1)]),
options = [
Headers = [Authorization = accessToken, #"Content-Type" =
"application/json;"], RelativePath ="reports/api/v3/workspace/{workspace_id}/search/time_entries",
Content = postData
],
Source = Web.Contents(baseUrl, options),
// since Web.Contents() doesn't parse the binaries it fetches, you must use another
// function to see if the data was retreived, based on the datatype of the data
parsedData = Json.Document(Source)
in
parsedData

 

2 REPLIES 2
ppm1
Solution Sage
Solution Sage

Looking at the Project page of that site shows at least that API method supports pagination.

 

ppm1_0-1682166068553.png

 

Perhaps the Workspaces one does too. You can either try it with pagination and List.Generate, or create a list of ids to be used as a start id for the next 50 records, as described in this video.

Power BI - Tales From The Front - REST APIs - YouTube

 

Pat

 

Microsoft Employee

Thank you for taking the time to respond. What I learned:

1) /pagination is not supported with Workspaces.

2) The video was very informative and I learned from viewing it, but I haven't found a way for the total number of records to be returned, so I'm not sure that creating a list of ids in a multiple of 50 would offer benefit.

Again, thank you for your time. My search continues.

Bob

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.