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 / Patching an existing r...
Power Apps
Answered

Patching an existing record

(0) ShareShare
ReportReport
Posted on by 391

Greetings fellow powerapps users!

I am attempting to patch an existing record and I can't figure out where I went wrong. The below code is on the "Submit" button.


What is working -  Onpress of the edit button, pause the refresh timer, set edit button visibility to false and the save button visibility true. I have achieved this. On press of the save button start the timer, Set save button visibility to false and edit button visibility to true. 

 

What isn't working - On save I also want it to patch updates to the existing records in a sharepoint list 'TimeTracker'.

 

Error receivedInvalid argument type. Expecting one of the following: Boolean, Number, Decimal, Text, OptionSetValue, UntypedObject. (This error isn't showing any red lines on the code; however, it isn't working as expected.)

 

 

 

Set(SubmitBtn, false) && Set(EditBtn, true) &&
Patch(
 TimeTracker, 
 Gallery2.Selected, 
 {
 Title: 'txt.Title',
 CostCode: 'txt.CostCode',
 'Time In':'txt.ClockIn',
 SwitchJob:'txt.Switch',
 'Time Out':'txt.ClockOut'
 }
);
UpdateContext({startTimer:true})

 Thanks in advance for any assistance! 
-CodyO

Categories:
I have the same question (0)
  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @CodyO,

     

    Try:

    Set(SubmitBtn, false);
    Set(EditBtn, true);
    Patch(
     TimeTracker, 
     Gallery2.Selected, 
     {
     Title: 'txt.Title',
     CostCode: 'txt.CostCode',
     'Time In':'txt.ClockIn',
     SwitchJob:'txt.Switch',
     'Time Out':'txt.ClockOut'
     }
    );
    UpdateContext({startTimer:true});

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • CodyO Profile Picture
    391 on at

    @Hey @AARON_C 

    Oddly enough I am now getting the same error I am getting on another part of this app.

    "The requested operation is invalid. Server Response: TimeTracker failed: Object must implement IConvertible.clientRequestIDL a730b8c8-6036-4293-8e21-f953bd669637 serviceRequestId:a730b8c8-6036-4293-8e21-f953bd669637"

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    @CodyO 

     

    Please also fix your patch function:

     

    Patch(
     TimeTracker, 
     Gallery2.Selected, 
     {
     // This needs to be the <-- 'Column name in data source': 'control name'.Text -->
     Title: 'txt.Title', 
     CostCode: 'txt.CostCode',
     'Time In':'txt.ClockIn',
     SwitchJob:'txt.Switch',
     'Time Out':'txt.ClockOut'
     }
    );

     

  • Verified answer
    CodyO Profile Picture
    391 on at

    Hey @AARON_C , I think I figured out my issue - I am able to patch existing records with everything but the dropdown. I currently have my "choice" fields in sharepoint list set to be fillable, and the choices are being pulled from another list. I think this might be causing an error. My workaround was adding a delete button. If someone enters the wrong Job number, they can just delete the record and recreate it with the correct number. I am still looking for a long-term solution to the dropdown issues, but for now I can say it's working mostly as expected. Thank you again for your help!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard