I have been working on a TimeSheet app with Sharepoint list; where I have list of employees whom I allocate jobs and time stamp the starting time. Once they complete the job I time stamp it again and calculate the duration of total time taken. I also time stamps any breaks they took and calculates total duration and at the end total time spent on doing a job.
I have been facing trouble calculating the duration between timestamps related to breaks. i.e. say a person took break 4 times in a day; each time 2 time stamps (Start and End) is recorded in a variable and then calcuates the duration using Text(Time(DateDiff))); I used Text(time because i wanted duration or any time recorded in 00:00:00 format. This worked till finding duration between 2 timestamps but when i tried to add another duration into the previously calculated break duration I get issues related to format and adding time. so to avoid spending more time i dropped the idea of getting duration in desired format and saved it in Number format and worked around using collection to record all the durations and then sum them up to get the final duration. (Other community members here points me into that direction; I thank them).
If any one can suggest a better way to do it while keeping the desired format '00:00:00' I would appreciate it.
All this is happening in 1 form which is attached to its parent list.
once I allocate the job to a person from list I can then delegate into that person's form and can see what job is allocated to him and also can update/change the record i.e recording breaks, end time, any comments etc.
All fine till here but let say; if I allocated a job and trigger a timestamp on his job that he went on break. when i go back to the listto choose to delegate into a different person record to look at his job state; I see timestamp of previous person as it is saved in a variable on that Form. If i change anything here previous person time stamp will be lost.
I wanted to explain you my scenerio so I could get advise on this.
My take on this is. Powerapp is using same form everytime I delegate into a record from list. that is why all the states of the variables and collections on that from are not private/locked to a record in its parent list.
What I want to clarify is; is there any way I can work around it with out recording every single variable state/collection into its parent record in sharepoint. What I mean is if I record everything into the sharepoint; it will then read everything back into relative variables and colletion etc when I delegate into each record from list. (I hope I am making sense).
Hi @u4jaanus ,
I think this is hard to achieved. Even if your user keeps the app open during the break, and you use a Timer control to count the time that he breaks, you will need one column to record this break time. But so far SharePoint list only have date or date and time column type. There is not such column type for only time recording. So it's hard to have the break time recorded and then have this break time to calculate with the duration of start and end time.
I know what you mean. I think I will be redesigning my tables again. For every event I would need to record that then fetch that data back whenever user access it and will need to perform calculations in the app to record timestamps/durations and then right it back to the table. Its a pain but I believe this is the only way.
I will still wait for Community members / experts to advise before I start putting time on it.