Hi there,
I've implemented a desk booking app which April Dunham developed. After changing it all to UK datetime and adjusting it the way we need for our needs I've come across a problem.
When testing in Power Apps when I search for a desk it checks the SP list and omits any already booked desks for the date/time selected. This is also the behaviour in the Power Apps app on mobile. However if someone accesses the Power App which is embedded in a Sharepoint site when selecting a desk it does not filter correctly even though it is pulling the same data. The only thing I can think of is something to do with Date/Time.
The SharePoint site is set to be the correct regional setting.
Here is the calendar function to collect what date/time has been selected:
Set(
selectedDate,
DateTimeValue(Calendar_1.StartDate)
);
Set(
selectedEndDate,
DateTimeValue(Calendar_1.EndDate)
);
Set(
startTime,
DateTimeValue(Text(
selectedDate, "dd/mm/yyyy"
) & " " & ddTimeFrom.Selected.Value
)
);
Set(
endTime,
If(
DateValue(
Text(
selectedEndDate, "dd/mm/yyyy"
)
) < DateValue(
Text(
selectedDate , "dd/mm/yyyy"
)
),
DateTimeValue(
Text(
selectedDate, "dd/mm/yyyy"
) & " " & ddTimeTo.Selected.Value
),
DateTimeValue(
Text(
selectedEndDate, "dd/mm/yyyy"
) & " " & ddTimeTo.Selected.Value
)
)
);
Here is the filter for displaying the desks:
Sort(Filter(
Desks,
Not(
Title in Filter(
'Desk Reservations',
CheckOutFromNumber>= Value(
Text(
startTime,
"yyyymmddhhmm"
)
) && CheckOutToNumber <= Value(
Text(
endTime,
"yyyymmddhhmm"
)
) || CheckOutFromNumber <= Value(
Text(
endTime,
"yyyymmddhhmm"
)
) && CheckOutToNumber >= Value(
Text(
endTime,
"yyyymmddhhmm"
)
)
).DeskText
) && Active = 1 && Floor = ddFloor.Selected.Value
),Title)
And here is the code for adding the selected desks into the SharePoint List so you know the format it's going in as:
orAll(
selectedDesks,
Patch(
'Desk Reservations',
Defaults('Desk Reservations'),
{
Title: currentUser.FullName & " " & ThisRecord.Title,
DeskText: ThisRecord.Title,
CheckOutFrom: DateAdd(selectedDate, "dd/mm/yyyy"),
CheckOutFromText: Text(selectedDate, "dd/mm/yyyy") & " " & ddTimeFrom.Selected.Value,
CheckOutFromNumber:Value(Text(selectedDate,"yyyymmddhhmm")),
CheckOutTo: DateAdd(selectedEndDate, "dd/mm/yyyy"),
CheckOutToText: Text(selectedEndDate, "dd/mm/yyyy") & " " & ddTimeTo.Selected.Value,
CheckOutToNumber: Value(Text(selectedEndDate,"yyyymmddhhmm")),
ReservedBy: currentUser.Email
}
)
);
Any ideas why the behaviour is so different between the two platforms?
Thanks
David
Hi. Did you get to the bottom of this? I have the same issue. Thanks, Vicki
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
179 | |
52 | |
41 | |
37 | |
28 |
User | Count |
---|---|
262 | |
80 | |
71 | |
69 | |
66 |