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 / How to submit a new fo...
Power Apps
Suggested Answer

How to submit a new form and edit form together?

(0) ShareShare
ReportReport
Posted on by 70
I have two forms (one is a new form and another is an edit form) and I want to submit the content of both forms together.
When I am using: Patch('Tracker',Defaults('Tracker'),Form1.Updates,Form2.Updates);Navigate('Success screen'), it is creating a new line item in the SharePoint. But I want the information to go in the same line item (basically update the line item in Sharepoint with new information).
 
How can I resolve this?
Categories:
I have the same question (0)
  • Nirav Raval (Akira28) Profile Picture
    153 Moderator on at
    Hi ratas101 ,

    May be you can try this one, if it works 🤞 (on Submit button)

    If(
        !IsBlank(Form1.LastSubmit), 
        Patch(
            'Tracker', 
            Form1.LastSubmit, 
            Form1.Updates, 
            Form2.Updates
        ),
        Notify("No existing record to update", NotificationType.Error)
    );
    Navigate('Success screen');


    ​​​​​​​If this post solved your issue, clicking 'Does this answer your question' will help others discover the solution and close the topic. If you found it helpful, a Like would be awesome!



    Regards,
    Nirav J Raval (Akira28)
     
  • Suggested answer
    Ammar Zaied Profile Picture
    97 on at
    Hi,
    Use a Variable to Store the Item ID:
    // When navigating to the edit form
    Set(currentItemID, YourItemID);
    Navigate(EditScreen);
    
    Patch Function Adjustment
     
    If(
        Form1.Valid && Form2.Valid, // Check if both forms are valid
        Patch(
            Tracker,
            LookUp(Tracker, ID = currentItemID), // Find the existing item by ID
            Form1.Updates,
            Form2.Updates
        );
        Navigate(SuccessScreen) // Navigate to the success screen only if Patch is successful
    )
    
     
    Handling Errors
     
    If(
        Form1.Valid && Form2.Valid,
        If(
            IsBlank(Patch(
                Tracker,
                LookUp(Tracker, ID = currentItemID),
                Form1.Updates,
                Form2.Updates
            )),
            Notify("Error updating item", NotificationType.Error),
            Navigate(SuccessScreen)
        ),
        Notify("Form validation failed", NotificationType.Error)
    )
    
     

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard