Hello Everyone,
I have an application which stores check in and check out data of employees and using SP List i.e Attendance.
When Someone Checks in, the Patch statement enters data, with current date and Status as "IN", and then other employee enters it's check in data and so on.
The issue is when I go for check out at the day end, I can't check out as my entry is above the one which has already Checked out.
My Entry is 2nd Last
Check in Button Code:
Patch(
Attendance, /*my SP List*/
Defaults(Attendance),
{
Title: "Check In&Out Test",
User: MyUser,
'User Email': User().Email,
WorkDate:Today(),
Check_x0020_In: Now(),
Status: "IN"
}
);
Navigate(CheckInSuccess,ScreenTransition.Cover)
Check Out Button Code:
Refresh(Attendance);
If(
First(Sort(Attendance,Modified,Descending)).Status="IN",
Patch(
Attendance,
First(Sort(Attendance,Modified,Descending)),
{
Check_x0020_Out: Now(),
Status: "OUT"
}
)
);
Navigate(CheckOutSuccess,ScreenTransition.Cover)
In Check out button, I am using First and Descending and status = "IN", but in SP List the last record is already checked out and Status Out, though which I am not able to check on my entry.
How can I Filter this Code for every User? on each day.
Help.
@
Solved! Go to Solution.
Try this code.
Refresh(Attendance);
If(
CountRows(Filter( ENTER YOU FILTER CONDITIONS )) > 0,
Patch(
Attendance,
First( Filter(Attendance,ENTER YOU FILTER CONDITIONS)),
{
Check_x0020_Out: Now(),
Status: "OUT"
}
)
);
Navigate(CheckOutSuccess,ScreenTransition.Cover)
You need to define filter conditions, You can filter the record by username the check in status or today date. Example
'User Email' = test@test.com,'Status'="IN"
Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.
Thanks,
Rahber
Try this code.
Refresh(Attendance);
If(
CountRows(Filter( ENTER YOU FILTER CONDITIONS )) > 0,
Patch(
Attendance,
First( Filter(Attendance,ENTER YOU FILTER CONDITIONS)),
{
Check_x0020_Out: Now(),
Status: "OUT"
}
)
);
Navigate(CheckOutSuccess,ScreenTransition.Cover)
You need to define filter conditions, You can filter the record by username the check in status or today date. Example
'User Email' = test@test.com,'Status'="IN"
Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.
Thanks,
Rahber
Hi @Rahber ,
It Worked Thanks, I applied the User and Today Filter and the app is now working fine Thanks!!
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
198 | |
172 | |
62 | |
33 | |
32 |
User | Count |
---|---|
339 | |
271 | |
105 | |
71 | |
58 |