I was able to find a solution. It goes as follows:
// Update existing items in SharePoint
ForAll(
Filter(Col_PatchBack, Not(IsBlank(pbID))),
UpdateIf(
SharePointList,
ID = pbID,
{
Hours: If(IsBlank(pbHours),0,pbHours),
Date: pbDate,
}
)
);
// Finally add new items to SharePoint
ForAll(
Filter(Col_PatchBack, IsBlank(pbID)),
Patch(
SharePointList,
Defaults(SharePointList),
{
Title: pbTitle,
Hours: If(IsBlank(pbHours),0,pbHours),
Date: pbDate,
}
)
);
You basically retrieve the ID of row for exisiting data and Patch it using UpdateIf, if ID exists it means you are updating existing item, if not its a new item.