
Hey folks,
I’m trying to use this Patch function in Power Apps to create new time entry records in a TimeEntries data source, but I keep getting errors on the first two lines (Patch(TimeEntries, Defaults(TimeEntries), {...})).
The error specifically points at these two line.
I’m pretty sure my data source is correctly connected, and I’ve checked the control names (ProjectDropdown, MonInput, etc.) multiple times.
Has anyone seen this kind of error before? What could be causing it?
Any help or pointers would be super appreciated! Thanks!
ClearCollect(TimeEntries,
{ MonInput: 1, TueInput: 2, WedInput: 3, ThurInput: 4, FriInput: 5, SatInput: 1, SunInput: 1, 'Total Hours': 7 }
);
Patch(
TimeEntries,
Defaults(TimeEntries),
{
MonInput: 1,
TueInput: 2,
WedInput: 3,
ThurInput: 4,
FriInput: 5,
SatInput: 6,
SunInput: 7,
'Total Hours': Sum(
First(TimeEntries).MonInput,
First(TimeEntries).TueInput,
First(TimeEntries).WedInput,
First(TimeEntries).ThurInput,
First(TimeEntries).FriInput,
First(TimeEntries).SatInput,
First(TimeEntries).SunInput
)
}
)