Hi @Anonymous ,
Regarding the issue that you mentioned, I think the Errors function could achieve your needs. If the Patch formula is not executed as expected, the following formula would include the error message:
Errors(mmmm)
On your side, you could detect if the Errors(mmmm) formula result is Empty or not, if it is empty, it means that your Patch function works well, otherwise, it means there is something wrong with your Patch function.
On your side, please consider modify your formula as below:
Set(
varReturnedRecord,
ForAll(
Gallery1_13.AllItems,
Patch(
mmmmm,
Defaults(mmmm),
...
)
)
);
If(
!IsEmpty(Errors(mmmm)), // Modify formula here
Microsoft365Outlook.SendEmailV2(...);Notify("Error: Your update to file ..."),
Microsoft365Outlook.SendEmailV2(...);Notify("Your updates to file ....")
)
For your mentioned formula, the varReturnedRecord variable would store a Table value rather than a Record value, so you should use IsEmpty function to detect if the varReturnedRecord is empty instead of IsBlank() function.
In addition, what do you mean about the "record is not patched to the DataSource"? Do you mean that the Patch function throws error? Regarding the formula that you mentioned, the varReturnedRecord variable would always contain records, even though, one of the records has not be patched to your data source. So you could not use the varReturnedRecord variable as check condition.
Regards,