06-07-2023 16:55 PM - last edited 06-07-2023 17:14 PM
Hi all,
I want my Power Apps to display my employee hours as 8 or zero accordingly under the days they work. I have a timesheet that track the days employees work in Sharepoint list. I am using a nested gallery. The function I use for the parent gallery is:
With(
{
TimesheetValue: Sort(
AddColumns(
GroupBy(
Filter(
varTimesheetData,
Month(Date) = Month(varCurrentDate)
),
"Title",
"StaffGP"
),
"EmployeeID",
First(StaffGP.EmployeeID)
),
Title,
SortOrder.Ascending
)
},
ForAll(
Sequence(CountRows(TimesheetValue)),
Patch(
Last(
FirstN(
TimesheetValue,
Value
)
),
{RowNumber: Value}
)
)
)
//////////////////////////////////////////////////
For the nested gallery, I am using:
ForAll(Sequence(31),If(Day(Last(FirstN(ThisItem.StaffGP,Value)).Date)=Value,"8","0"))
Because the employees do not work everyday, I am having trouble displaying "8" or "0" accurately underneath the date. For example, employees do not work on Sundays but they work on Mondays, but the App is showing "0" for Mondays. Can anyone help? Thanks.