Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Patch Function Error

(0) ShareShare
ReportReport
Posted on by

I am working on teams power app.

 

I am trying to use the below code but getting error Invalid argument.

Please guide the correction in this code :

Patch(
TablePartsReturnA,
If(gblReturnNewRecord, Defaults(TablePartsReturnA), SearchResultGallery_3.Selected),
{
FormNo: TextBox2.Value,
FormDate: TextBox2_1.Value,
Product: TextBox2_2.Value,
FCNo: TextBox2_3.Value,
FCissueDate: TextBox2_4.Value,
FCTargetDate: TextBox2_5.Value
}
);
Set(gblReturnNewRecord,false);

 

MIA27_0-1711821976907.png

 

 

 

  • Himanshu_90677 Profile Picture
    416 on at
    Re: Patch Function Error

    Hey @MIA27 

    Please enter date as datepicker1_1.selecteddate or datepicker1_1.selected.date

  • MIA27 Profile Picture
    on at
    Re: Patch Function Error

    Was able to fix the column name issue, it was nothing but the space after :

    Form: TextBox

    To be 

    FormNo:TextBox

     

    No red color under line was there, but after save button click was the below error

    Now stuck with another error

    MIA27_2-1711894966531.png

    And again all my lines get underline with error

     

    MIA27_3-1711895073184.png

     

     

  • MIA27 Profile Picture
    on at
    Re: Patch Function Error

    Dear Rogier,

    The link situation is different, where the column has been renamed.

     

    As you advised, I went line by line, means deleted all line of patch and started working by one field one by the help of auto selection which comes by its own, below is the image

     

    MIA27_0-1711893781692.png

     

    I selected FormNo, Not type it, so NO error question arises here.

    This FormNo Data type is Number. 

    Then after this selection another , another error is coming up.

    Please note in the image by itself the error dialog shows the field name is cr333_formno, type error it shows.

     

    MIA27_1-1711893984771.png

     

    Note : That the number which I will supplying will be number, later, then how come up with the error of this.

    Guide me to fix one field the current one and then will be able to line by line.

     

    Regards

     

     

     

     

     

  • RogierE Profile Picture
    862 Super User 2025 Season 1 on at
    Re: Patch Function Error

    Were you hovering over the formula row describing FcNo when this occurred? Then this is the specified column that does not exist. 
    check out this post of mine to see how to solve that:Unknown Column in SharePoint List

     

    Please LIKE the reply and ACCEPT it as the solution if the answer is what you were looking for.
    (to help me grow in community rank and help others find the solution)

  • MIA27 Profile Picture
    on at
    Re: Patch Function Error

    I tried, the error is not understood to me. as you advised, on each line and try to obtain the error indicator, found the below on each line:

    MIA27_0-1711882702499.png

     

    Error : the specified column "_" does not exist.

    For example 

    FcNo is the column header name in the table

    FCissueDate is the column header name in the table

    and so on.

     

    Below is the images I have taken from table screen, which shown the correct name mentioned :

    MIA27_1-1711883006270.png

     

     

    Can you guide how to be cross checked further,

     

  • RogierE Profile Picture
    862 Super User 2025 Season 1 on at
    Re: Patch Function Error

    Please repeat the same procedure until you run out of errors:

    - hover over all of the rows in your formula

    - wait until it changes the feedback to a specific error

    - correct that error

    >repeat 🙂 

  • MIA27 Profile Picture
    on at
    Re: Patch Function Error

    Dear,

    As guided by all of your, I have changed the controls and had matched with the data type of the table.

    Please review my last post with error and full code and guide me for the correction

    Regards

     

  • MIA27 Profile Picture
    on at
    Re: Patch Function Error

    Dear Mr. Himanshu,

    please find reply posted having still the error in details, I change the fields according to the table column data type,

    Still the error.

     

    Please review and guide

     

     

  • MIA27 Profile Picture
    on at
    Re: Patch Function Error

    Dear Mr. Rogier,

    Noted and change all the Input field on the screen according to the Table. (I mean if table column is Date Field Type, the I selected Date picker for data entry.

     

    so revised the code as below , but still getting the error of invalid arguments:

    Patch(
    TablePartsReturnA,
    If(gblReturnNewRecord, Defaults(TablePartsReturnA), SearchResultGallery_3.Selected),
    {
    FormNo: TextBox2.Value,
    FormDate: DatePicker1.Value,
    Product: ComboBox1.Selected,
    FCNo: TextBox2_3.Value,
    FCissueDate: DatePicker1_1.Value,
    FCTargetDate: DatePicker1_2.Value,
    }
    );
    Set(gblReturnNewRecord,false);
     
     
    MIA27_0-1711879178173.png

     

    Kindly review my code, now what the mistake, as I fixed with the data type and cross checked all.

     

    Please guide

     

  • trstrean Profile Picture
    181 on at
    Re: Patch Function Error

    It's hard to determine what could be your issue based on the info you provided.  Is everything a text field?  You can narrow down where the issue is by removing fields to find which one is causing the issue.  My guess would be your date field could be the problem, but if you are updating a text field than what you are doing would work.  If the data source has choice fields, your approach wouldn't work for that field type.  Once you figure out which field is the problem, identify a data type mismatch and adjust the syntax to provide the right info to the data source.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard