Comments (3)
Hi @smartphreak,
Sorry for the delay.
This google sheet makes use of the Detailed Report API from Toggl. From the documentation I understand the report returns all time entries for all users. Each time entry contains the user id and the full name of the user. This is the same API used by the Toggl user interface Reports > Detailed.
So if you want to have the user information you need to modify the data structure that is created inside the fetchTimesheet()
fuction inside the Code.gs
file.
This function creates a timesheet
hash (dictionary):
timesheet = {
date1: {
client1: duration_for_date1,
client2: duration_for_date2,
...
},
date2: {
},
...
}
timesheet
contains all aggregated time entries per client per day for 1 month.
Every date##
property of timesheet
represents a day of the month. And contains the time spent per client.
Every client##
property of a date##
contains the time spent for that client during the day represented by date##
.
This timesheet
data structure is used to populate a sheet inside the Google Sheet spreadsheet. Which is handled by the createTimesheet()
function inside the Code.gs
file.
As I am the only person using that workspace, this data structure only represents the data for 1 user.
To create a timesheet per user, you will probably need to create a data structure that could look as follows:
timesheets = {
uid1: {
name: 'full name'
timesheet: {
date1 : {
...
},
date2 : { ... },
...
},
uid2: { ... },
...
}
}
Does this answer your question ?
Now I have to say that looking back at the code, I could have created a simpler data structure based on arrays:
timesheets = [
{
uid: 1,
user: 'John Doe',
timesheet: [
{
clients: [
{
name: 'client1',
duration: 5236
},
{
name: 'client2',
duration: 5236
},
....
]
},
{ ... },
...
]
},
{
uid: 2,
user: 'Jane Doe',
timesheet: [
{...}
]
},
...
]
from toggl-google-sheet.
cheers @smartphreak
just came over your question and this repo from @Voronenko may also be helpful for you, as i think, that it does the job you need: https://github.com/Voronenko/toggl_invoice
Best regards
from toggl-google-sheet.
Hi @smartphreak what do you mean by all the time data per user?
Do you mean all the time data aggregated per user per day?
Like ...
Date | User | Time |
---|---|---|
2022-01-05 | user1 | 6:51 |
2022-01-05 | user2 | 5:12 |
2022-01-05 | user3 | 8:03 |
2022-01-06 | user1 | 2:36 |
2022-01-06 | user3 | 4:21 |
from toggl-google-sheet.
Related Issues (16)
- 01/04/2015 as timesheet month imports March 2015 HOT 3
- More than one property into google sheets HOT 3
- Add project, description and user in summary HOT 4
- Automate the upload of .gs app script files using Google Drive import API HOT 1
- Adding names, descriptions, start/end times to the report HOT 2
- The import of April 2015 did not import the Toggl times for 30/04/2015 HOT 1
- it's not getting all data HOT 1
- Update API Url Domain to api.track.toggl.com HOT 2
- A confirmation should be asked when an existing month is being overwritten by an import
- UrlFetchApp Error HOT 2
- 01/06/2015 as import month imports May 2015 HOT 1
- When setting 04/06/2015 as import month the 2 first days of June are not imported HOT 1
- Generate a summary with the total hours and days per customer
- The import for July 2015 did not import the 01/07 HOT 2
- Importing for august 2015 did not import times for the 08/31 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toggl-google-sheet.