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 - Building 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
    How to submit a new form and edit form together?
    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
    How to submit a new form and edit form together?
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 629 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 397 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 232 Moderator

Last 30 days Overall leaderboard