Hi @samuelJ ,
Based on the formula you provided, I think there is something wrong with the Errors function that you mentioned.
The first argument of the Errors function is required to provide a data source rather than a record, the result the Patch function returned is a record value.
I have made a test on my side, please consider modify your formula as below:
If(!IsEmpty(toUpdateSmall),
If(
IsEmpty(
Errors('[dbo].[ForecastData]', Patch('[dbo].[ForecastData]', toUpdateSmall)) // Modify formula here
),
Notify("Database toUpdateSmall write succesful", Success);
//put update collection code here
,Notify("Database toUpdateSmall write NOT succesful", Error);
ForAll(RenameColumns(toUpdateSmall, "ItemId", "ItemId2", "ForecastMonth", "ForecastMonth2", "ForecastYear", "ForecastYear2", "SalespersonId", "SalespersonId2", "CustomerKeyAccountParentId", "CustomerKeyAccountParentId2", "CurrentForecastQty", "CurrentForecastQty2"), Update(datasource_temp2, LookUp(datasource_temp2, SalespersonId2 = SalespersonId && ItemId2 = ItemId && CustomerKeyAccountParentId = CustomerKeyAccountParentId2 && ForecastMonth = ForecastMonth2 && ForecastYear = ForecastYear2), {CurrentForecastQty:CurrentForecastQty2, CustomerKeyAccountParentId:CustomerKeyAccountParentId2, ForecastMonth:ForecastMonth2, ForecastYear:ForecastYear2, ItemId:ItemId2, SalespersonId:SalespersonId2}))
));
or
If(
!IsEmpty(toUpdateSmall),
Patch('[dbo].[ForecastData]', toUpdateSmall);
If(
IsEmpty(
Errors('[dbo].[ForecastData]') // Modify formula here
),
Notify("Database toUpdateSmall write succesful", Success);
//put update collection code here
,Notify("Database toUpdateSmall write NOT succesful", Error);
ForAll(RenameColumns(toUpdateSmall, "ItemId", "ItemId2", "ForecastMonth", "ForecastMonth2", "ForecastYear", "ForecastYear2", "SalespersonId", "SalespersonId2", "CustomerKeyAccountParentId", "CustomerKeyAccountParentId2", "CurrentForecastQty", "CurrentForecastQty2"), Update(datasource_temp2, LookUp(datasource_temp2, SalespersonId2 = SalespersonId && ItemId2 = ItemId && CustomerKeyAccountParentId = CustomerKeyAccountParentId2 && ForecastMonth = ForecastMonth2 && ForecastYear = ForecastYear2), {CurrentForecastQty:CurrentForecastQty2, CustomerKeyAccountParentId:CustomerKeyAccountParentId2, ForecastMonth:ForecastMonth2, ForecastYear:ForecastYear2, ItemId:ItemId2, SalespersonId:SalespersonId2}))
));
Please consider take a try with above formula, then check if the issue is solved.
Best regards,