Re: Retrieving Date & Time Submission
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.