I have two buttons on two different screens to patch to different SharePoint lists when a toggle has been set showing a record has changed. One works but the other one doesn't and I can't figure out why.
The one that works is OnSelect:
If(varM_DisplayMode="Edit",
ForAll(Filter(galM_Membership.AllItems, tgM_ChangeRecord.Value=true,Not(IsBlank(ddM_CommitteeCode))),
Patch(Membership, ThisRecord,
{M_CommitteeCode: Text(ddM_CommitteeCode.SelectedText.Value),M_CommitteeTitle: txtM_CommitteeTitle.Text})));
The one that doesn't, again under OnSelect, is:
If(varAP_DisplayMode="Edit",
ForAll(Filter(galAA_AgendaPlanner.AllItems, tgAA_ChangeRecord.Value=true,Not(IsBlank(ddAA_CommitteeCode))),
Patch(AgendaPlanner, ThisRecord, {
AP_CommitteeCode: Text(ddAA_CommitteeCode.SelectedText.Value),AP_MeetingDate: DateValue(ddAA_MeetingDate.SelectedText.Value)})));
The error message isn't very helpful as all it says is 'The function 'Patch' has some invalid arguments'. Both codes look the same (apart from variable names) and it is driving me mad - I love PowerApps but why does it have to be so fickle?
Any help gratefully received.