The type of this argument does not match the expected type. Found type 'Record'.

MM 0 Reputation points
2025-12-16T04:01:58.42+00:00
Patch(
    Records,
    ThisItem,
    {
        BorrowStatus: { Value: "Returned" },
        ReturnDate: Today()
    }
);

Patch(
    Books,
    LookUp(Books, BookID = ThisItem.BookID),
    {
        BorrowStatus: {Value: "Available"}
    }
);


in power app both borrowstatus i tried everything but it still error thank you!

Microsoft 365 and Office | Excel | For education | Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-16T04:02:07.3166667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    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:

    0 comments No comments

  2. Jeanie H 7,850 Reputation points Microsoft External Staff Moderator
    2025-12-16T04:41:57.53+00:00

    Dear @MM

    Thank you for posting your question in the Microsoft Q&A forum.  

    From your description, I understand that the problem you are encountering is related to using the Patch() function in Power Apps. 

    While I am happy to assist, the primary area of expertise for our current support team mainly focuses on core Office 365 products. Power Apps is a Low-Code/No-Code Rapid Application Development platform belonging to the Microsoft Power Platform, which requires in-depth knowledge of formulas, connectors, and Power Apps application architecture. 

    To ensure you receive the most professional, most accurate, and quickest assistance for your code and application, I highly recommend that you post your question on the Microsoft Power Platform Community Forum Thread

    This is the official forum where Power Apps Development Experts, Microsoft Engineers, and highly experienced Community members converge. They specialize in resolving complex issues related to formulas, connectors, and performance within Power Apps. 

    There, you will find a wealth of articles, examples, and specific solutions directly related to functions like Patch(), LookUp(), and data source issues, areas where our Office 365 support team may have limited resources. 

    Posting your question on a specialized channel will ensure it reaches the most qualified group of respondents, thus shortening the time required to find an effective solution. 

    You can post your question here: Microsoft Power Platform Community Forum Thread (This link will take you to the Power Apps development section). 

    I greatly appreciate your understanding. I hope you quickly find a solution for your Power Apps application! 

    Looking forward to your response! 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.