web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to submit a new fo...
Power Apps
Unanswered

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

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