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
Unanswered

Patching data

(0) ShareShare
ReportReport
Posted on by 34

Whats the best way to patch data collected over two different screens?

Categories:
I have the same question (0)
  • BCLS776 Profile Picture
    8,994 Moderator on at

    Patch directly to the data source(s) or to a collection. Both have global scope across your app, so you can access them on any screen.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The best way is to patch your collection using a record from that collection, and using multiple forms to gather the data that you want to patch

     

    So let's say that

    1. You have a collection: colYourCollection which is shown in a gallery

    2. You've setup up 2 forms to contain the information that you want to edit (Form1 and Form2) and these forms are on two screens (Screen_Form1 and Screen_Form2 respetively)

     

    For Form1 and Form 2 you'll need to set

     

    Datasource = colYourCollection
    Item = varRecordFromYourCollection

     

     

    In your gallery add in a button and in the onSelect run the following code

    ResetForm(Form1);
    ResetForm(Form2);
    Set(varRecordFromYourCollection, ThisItem);
    Set(Form1, FormMode.Edit);
    Navigate(Screen_Form1,ScreenTransition.Fade);

     

    When you navigate to Screen_Form1 you have a button that navigates to Screen_Form2

     

    Navigate(Screen_Form2,ScreenTransition.Fade);

     

    And then finally on Screen_Form2 you have a save button that adds in the edits from Form 1 and Form 2 - and shows if the operation was successful or not. 

     

    Patch(colYourCollection, varRecordFromYourCollection, Form1.Updates, Form2.Updates);
    
    If(IsEmpty(Errors(colYourCollection)),
     // If no errors
     Notify("Success", NotificationType.Success); 
     Navigate(Screen_StartingScreen),
    
     //If we have errors 
     Notify(First(Errors(colYourCollection)).Message, NotificationType.Error)
    );

     

    You can add in more than 2 forms of course, and there are other things you can do as part of this flow to make it all run together better, but this is the best way IMHO.

     

     

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
Haque Profile Picture

Haque 103

#2
WarrenBelz Profile Picture

WarrenBelz 82 Most Valuable Professional

#3
wolenberg_ Profile Picture

wolenberg_ 67 Super User 2026 Season 1

Last 30 days Overall leaderboard