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 Apps
Answered

Patch Issue

(0) ShareShare
ReportReport
Posted on by 35

Hi Guys

 

Hope you can assist? I've got a vehicle check app that allows users to update things like Registration expiry and Service due information. This works only if I'm updating one field at a time. If I try to change more than one of these fields, it defaults back to the previous values. The formula I'm using is: 

 

Patch(ListVeh2,ThisItem, {'Wof Expiry':DPCChangeWOFDATE.SelectedDate,'Registration Expiry':DPCChangeRegistrationDATE.SelectedDate,'COF Expiry':DPCChangeCOFDATE.SelectedDate,'Service Due kms':Value(UpdateServicekms.Text)})

 

Any help would be appreciated. Thanks

Patch question.PNG
Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,581 Most Valuable Professional on at

    Your code is correct.  The problem is that you aren't setting the defaults on the DatePickers using the default values in the item being edited.  So when you Patch its picking up the date field that you changed, but all the rest are being set back to the defaults in the datepickers.  Make sure the DatePicker for each field defaults to the value in the field when you edit the record.  Then whichever field you change that field will be saved when you Patch and the other fields will overwrite the existing values with the values that are already saved.  Make sure you do the same for UpdateServicekms too.

  • Kiwi22 Profile Picture
    35 on at

    That makes sense, thank you very much. Would something like CurrentDate() work in the default value?

     

  • Pstork1 Profile Picture
    69,581 Most Valuable Professional on at

    yes you can set the default to the currentDate, but if you do that all the fields that you don't edit will get set to the current date.  I thought that was what you were trying to avoid.

  • Kiwi22 Profile Picture
    35 on at

    Sorry, you're right. I didn't phrase my question correctly.  I've changed the default to ThisItem."Field I want to show if it's empty". I've done some testing and this seems to have worked, thank you very much for the 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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 333 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 86 Super User 2026 Season 1

Last 30 days Overall leaderboard