The error message indicates that there is a type mismatch for the BorrowStatus argument in your Patch function. Specifically, it seems that the expected type does not align with what is being provided in your code.
In your first Patch statement, you are correctly updating the BorrowStatus with the value { Value: "Returned" }. However, in the second Patch statement, the syntax used for updating BorrowStatus appears to be incorrect. You are using an additional set of curly braces, which is not necessary. The correct way to update BorrowStatus should be as follows:
Patch(
Books,
LookUp(Books, BookID = ThisItem.BookID),
{
BorrowStatus: { Value: "Available" }
}
);
By removing the extra curly braces around BorrowStatus, you should resolve the type mismatch error. Ensure that the structure of the object you are passing matches the expected structure defined in your data source for BorrowStatus.
If you continue to experience issues, double-check the data types defined in your data source for BorrowStatus to ensure they align with what you are trying to patch.
References: