I have a Canvas app so that users can allocate hours to projects they are working on. On the initial save (when Save button is clicked), the patch works well and it is written to the list. However, if any changes are made to the already existing gallery item, any subsequent changes are not saved to the SharePoint list. I am noticing that the values revert back to the initial save. I have a total of three buttons in play here with only one being visible to the user, the Save button. Here is the expression I have on it's OnSelect property:
Set(
varResult,
Patch(
ProjectTimeTrackerv2,
ShowColumns(
colGridUpdates,
"StartDate",
"EndDate",
"NumberOfWeeks",
"TotalHours",
"HoursPerWeek",
"ProjectLookup",
"Manager",
"DCIO",
"Resource",
"ID"
)
)
);
Select(Button6_1);
Notify(
"Your hours have been saved!",
NotificationType.Success,
3000
);
Here is the expression I have for my Button6_1 button:
ClearCollect(
colGridData,
Filter(
ProjectTimeTrackerv2,
ProjectLookup.Value = RecordsGallery1.Selected.Project
)
);
Clear(colGridUpdates);
Set(varReset,false);
Set(varReset,true);
Lastly, here is the expression I have for my last button, Button4_1, which is located directly within my Gallery:
If(
IsBlank(
LookUp(
colGridUpdates,
ID = ThisItem.ID
)
),
Collect(
colGridUpdates,
ThisItem
)
);
UpdateIf(
colGridUpdates,
ID = ThisItem.ID,
{
StartDate: startDate.SelectedDate,
EndDate: endDate.SelectedDate,
TotalHours: Value(TtlHrsPerWeekLbl.Text),
NumberOfWeeks: numWeeksLbl.Text,
HoursPerWeek: txtHrsAllocated.Text,
Manager: txtMgr_1.Text,
DCIO: txtDCIO_1.Text,
Resource: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & resourceCB.Selected.Mail,
Department: "",
DisplayName: resourceCB.Selected.DisplayName,
Email: resourceCB.Selected.Mail,
JobTitle: "",
Picture: ""
}
}
)
Any guidance would be greatly appreciated!