web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch - Invalid Argume...
Power Apps
Answered

Patch - Invalid Argument Type Control, Expecting Record Value

(0) ShareShare
ReportReport
Posted on by 920 Super User 2024 Season 1

Hi,

 

Getting an error on this on the OnSelect of a button - 

 

Patch('Intake', ID , {' Lead_three': Dropdown2.Selected.Value });

 

getting the error on my ID. 

 

Why is this?

 

Thanks.

Categories:
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @wonka1234,

     

    Do you want to update a record? The second parameter will need a record reference, I will add some examples below:

    Patch(
     'Intake', 
     <RecordReference>, 
     {' Lead_three': Dropdown2.Selected.Value }
    );
    
    //You can change <RecordReference> with e.g. ThisItem in a Form / Gallery, a record saved to a variable, Gallery.Selected...
    //Should the schema not fully match use {ID: ThisItem.ID} instead
    //In a ForAll you may need the optional ThisRecord. instead of ThisItem
    
    //Should you want to create a record use Defaults('Intake') instead

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    @LaurensM  Yes update a record. However my button isnt in a editform or gallery. ITs just on a screen.

  • LaurensM Profile Picture
    12,516 Moderator on at

    @wonka1234 which record would you like to update and do you have the record or ID stored somewhere? (or selected via a Gallery)

  • wonka1234 Profile Picture
    920 Super User 2024 Season 1 on at

    I have the "ID" field or "gblRecordID" which is a #. But neither of these options work

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    @wonka1234, you will have to make sure that gblRecordID's value is the correct ID of the record you would like to update. Assuming the correct ID is saved, you can use the following structure to update your record:

     

    Patch(
     'Intake', 
     {ID: gblRecordID}, 
     {' Lead_three': Dropdown2.Selected.Value }
    );
    
    //Alteratively try:
    Patch(
     'Intake', 
     LookUp('Intake', ID = gblRecordID), 
     {' Lead_three': Dropdown2.Selected.Value }
    );

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard