web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    Re: Patching data

    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
    on at
    Re: Patching data

    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

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 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard