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 / SP- submit creates dup...
Power Apps
Unanswered

SP- submit creates duplicate items instead of updating

(0) ShareShare
ReportReport
Posted on by 118

Hello,

 

I have a screen on my powerapp that contains a gallery of the items in my sharepoint list. A user opens the gallery item on a new screen and fills out delivery information in a form that is connected to the SP list. However, when a user submits the delivery information, it is creating a duplicate line item instead of updating the one that has been selected. 

 

This is my submit button code: Patch('Transfer Sheet & Product Availability',If(Form1.Mode=FormMode.Edit,SharePointIntegration.Selected,Form1.Mode=FormMode.New,Defaults('Transfer Sheet & Product Availability')), Form1.Updates,Form12.Updates,Form14.Updates,Form15.Updates,Form8.Updates)

 

Any input would be great. I know that form1 has to be in edit mode in order for the record to be changed instead of submitted. What step have I missed?

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,991 Moderator on at

    @ebraga 

    I think you could simplify the code greatly like this.  If you use a 'bulk update' technique for PATCH it is not necessary to create an IF statement for New vs Edit mode.

    ClearCollect(
     colFormUpdates, 
     Form1.Updates,
     Form12.Updates,
     Form14.Updates,
     Form15.Updates,
     Form8.Updates
    );
    Patch(
     'Transfer Sheet & Product Availability',
     colFormUpdates
    );

     

     

    For more info about 'bulk updates' using the PATCH function check out this article
    https://matthewdevaney.com/patch-multiple-records-in-power-apps-10x-faster/

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard