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

Notifications

Announcements

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:
I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard