Hi All,
I have a Patch & ForAll in a Scheduling application.
My custom form allows to choose multiple dates and it replicates the time, add's it to a collection and I display it on the screen.
Then, when you press save, it Patches through to the SharePoint List.

Collection per click on calendar item
Patch(
colAddEvent,
Defaults(colAddEvent),
{
LessonNo: varAddLesson +1,
LessonDateStart: DateAdd(_firstDayInView,ThisItem.Value,Days),
LessonDateEnd: DateAdd(_firstDayInView,ThisItem.Value,Days),
StartHour: ddStartHour_3.Selected.Value,
StartMinute: ddStartMinutes_3.Selected.Value,
EndHour: ddEndHour_3.Selected.Value,
EndMinute: ddEndMinutes_3.Selected.Value
}
);
UpdateContext({varAddLesson: varAddLesson + 1})
Save Button (Patch to SharePoint List)
If(
lblDoubleBooked_1.Visible = true Or IsBlank(TeacherSelector_1),
UpdateContext({showErrorBox: true}),
ForAll(
galleryClassAdd_1.AllItems,
Patch(
DB_Timetable,
Defaults(DB_Timetable),
{
ParticipantsPicker:
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & PersonSelector_1.Selected.Mail,
Department: "",
DisplayName: PersonSelector_1.Selected.DisplayName,
Email: PersonSelector_1.Selected.Mail,
JobTitle: "",
Picture: ""
},
Event: event_1.Text,
Category: CategorySelector_1.Selected,
Location: txtLocation_1.Text,
LessonNo: txtLessonNoAdd_1.Text
EventDate: DatePicker1.SelectedDate + Time(
Value(ddStartHour_4.Selected.Value),
Value(ddStartMinutes_4.Selected.Value),
0
),
EndDate: DatePicker1.SelectedDate + Time(
Value(ddEndHour_4.Selected.Value),
Value(ddEndMinutes_4.Selected.Value),
0
)}));
Refresh(DB_Timetable)
Problem
- When the data is patched, sometimes the time is changed which displays incorrect data on the schedule for workers.
Here is an example of what happened, the time should be 08:00 - 10:00

Sometimes it does it correctly up to 10 records, and then it goes an hour back.
Please can someone shed some light.
Thank you