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 Function to upda...
Power Apps
Unanswered

Patch Function to update an existing record on a form with multiple screens

(0) ShareShare
ReportReport
Posted on by

I'm struggling to understand how the Patch function works so I can use Power Apps to update an existing record that was created from the same app, but gathering information on a different screen in the form to add to the record.

 

This is the formula I've been tweaking with no luck:

 

Patch('Safety Incidents',LookUp('Safety Incidents',ID),{'Corrective measures and best practices':'Corrective measures and best practices_DataCard3'.Text,'Supervisor Signature':Signature_DataCard1'.Text)

 

Safety Incidents = Data Source

ID = the unique list identifier to find the correct list entry

Corrective measures and best practices  AND Supervisor Signature are the two fields of info I want to add to the existing record.

 

It's probably also important to note that I'm not getting an error message, it's just not updating the record.

 

What am I doing wrong?

Categories:
I have the same question (0)
  • turnerj3 Profile Picture
    2,039 on at

    @ahartsfield ,

    Do you have the id of the item you are wanting to edit? When you do the Lookup it needs to know which I’d. ID=14 or ID=Gallery.Selected.ID

     

    Also if you have the record pulled up in an edit form where you are using the data cards you could just use SubmitForm(FormName) instead of patching.

  • PowerNuggets Profile Picture
    360 on at

    .

  • PowerNuggets Profile Picture
    360 on at

    hi @ahartsfield 

     

    If i understand you correctly you need to update an existing record, please see the example below it may help

     

    1) When you create a new record the button will have onSelect properties below

    ResetForm('Form 1');
    Set(
    varFormData,
    Defaults('datasource')
    );
    Set(
    varFormMode,
    FormMode.New

    Navigate('Form1 Screen')


    2) when you update a record the update button will have onSelect properties below

    ResetForm('Form 1');

    Set(
    varFormData,
    ThisItem
    );
    Set(
    varFormMode,
    FormMode.Edit
    );
    Navigate('Form1 Screen')

     

    3) for the Form1 Screen, the form will have the below :


    Form 1 Datasource: Data source
    Form 1 Defaultmode : varFormMode
    Form 1 Items: varFormData

     

    and for the submit button the below for onSelect property

    Patch(
    'datasource name',
    varFormData,
    'Form 1'.Updates,


    \\ check the success by the below

    If(
    IsEmpty(Errors('Datasource')),
    Notify(
    "Success",
    NotificationType.Success
    );
    Navigate('Success Screen of your choice'),

    Notify(
    First(Errors('Datasource')).Message,
    NotificationType.Error
    )

    -----------------------------------------

    Please click Accept as a solution if my post helped you solve your issue. This will help others find it more easily. It also closes the item.

     

    Kind Regards,

  • ahartsfield Profile Picture
    on at

    Thank you! I tried this initially, but it returned an error about my Patch (and I didn't have a Patch...so I assumed I needed one). But the edit form is up with the initially submitted data on Screen 1 and then Screen 2 has the additional information that the supervisor fills in at a later time. 

     

    To answer your first question - no, I don't have the ID of the specific item. I need that field to be dynamic for whatever form is being edited. I do have a way to reference it though, I'll just need to figure out that formula.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard