I'm building a clock in system for employees with power apps using SharePoint as a data source. I have a "Date Picker" in the app that is not visible and made the default Fx read
Date: Now()
Hour: Text(Hour(Now()),"00")
Minute: Text(Minute(Now()),"00")
So that when employees clocked in it would automatically get their time submission without tampering. But now I want to navigate to a second page to show what was submitted but I am not sure how to retrieve it. I would also like to get the total hours for the day and week but I'm not sure how I would do that using the date picker
I tried EditForm1.LastSubmit.'Date and Time' in the date picker field but that didn't work.
Plz & Thanks!
Thank you for the reply! @ShaheerAhmad
my SharePoint list is called "Time List" & column for date submission is called "Date and Time"
I tried the formula you gave but I couldn't get it to run but I'm sure it's something on my end.
#1. I created a canvas app that started from Sharepoint which populated fields , not starting from scratch. My columns in Sharepoint include the following: Title, Input, EmployeeID, Job, Date and Time.
#2. On the first page, I have dropdown buttons with one having the choices of Input (PunchIn/PunchOut), EmployeeID(1-10), Job (office,warehouse...etc) and date and time (which I have the "NOW" codes inserted in the default date). On the second page I wanted to display those choices last submitted as well but couldn't get a formula that worked. The dropdown buttons are datacards-Datacardkeys, so I'm not sure if that needs a completely different formula.
#3.What I ended up doing was inserting a brand new dropdown box for each choice ( Input, EmployeedID, Job, date and time) on the first screen connecting them with my data source from SharePoint. Under the properties panel to the right, items read "Time List". On the second screen, I choose to insert a text box with the text formula reading "Input: " & Dropdown3.Selected.Value. This worked and showed the last Input submitted and I did the same for Employee ID and was successful. Now the problem is, the new dropdown boxes don't update in SharePoint even though the submission is successful. But when I choose to use the original dropdown boxes, I can't get a formula to show the last submissions on the second page.
To retrieve the date and time submission in your Power Apps app, you can follow these steps: Make sure you have a data source connected to your app that stores the submitted clock-in information. In your case, it is SharePoint. On the second page where you want to show the submitted data, add a label or any other control to display the date and time. Set the Text property of the label/control to reference the date and time value from the SharePoint data source. Assuming you have a SharePoint list named "ClockInData," and the column name for date and time is "SubmissionDateTime," you can use the following formula:
First(Filter(ClockInData, ID = EditForm1.LastSubmit.ID)).SubmissionDateTime
This formula retrieves the SubmissionDateTime value from the item in the SharePoint list with an ID that matches the ID of the last submitted form.
To calculate the total hours for the day and week, you need to aggregate the clock-in data for the specific employee and date range. You can achieve this by using functions like Filter, Sum, and GroupBy. Here's an example of calculating the total hours for the current day:
Sum(Filter(ClockInData, Employee = User().Email && Date(SubmissionDateTime) = Date(Now())), TimeValue(Hour(SubmissionDateTime) & ":" & Minute(SubmissionDateTime)))
This formula filters the ClockInData list to retrieve entries for the current user (assuming the employee's email is stored in the "Employee" column) and the current day. It then sums up the time durations by converting the SubmissionDateTime values to a time format.
For calculating the total hours for the week, you can adjust the filter condition to match the desired date range. For example, you can use:
Sum(Filter(ClockInData, Employee = User().Email && Date(SubmissionDateTime) >= Date(Now()) - Weekday(Now()) + 1 && Date(SubmissionDateTime) <= Date(Now())), TimeValue(Hour(SubmissionDateTime) & ":" & Minute(SubmissionDateTime)))
This formula calculates the total hours for the current week by filtering the data within the date range from the start of the week (Sunday) to the current day.
Make sure to adjust the formula according to your column names, data structure, and requirements.
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional