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 / Powerapp form updates ...
Power Apps
Unanswered

Powerapp form updates first item of the list and create new item at same time

(1) ShareShare
ReportReport
Posted on by 10

Hi,

 

When a user submits new item form the data gets save in the list and at the same time the first item of the list is updated with new item data. This issue occurs rarely. Here I just want to save new item and I don't want to update existing item but due to this issue first item of the list is updated. I am not updating specific item anywhere in the form.

I am using Sharepoint Integration OnSave command(see attached picture) and in that SubmitForm() function is used to save/update data.

 

Untitled.png

 

 

 

If you guys have any solution then let me know. I have been facing this issue since 2months

 

Thanks and Regards,

Dilip Nayak

 

 

 

Categories:
  • jhall Profile Picture
    636 on at

    I think you're going to need to explain more detail here.  I'm not sure where "OnSave" comes into this.  I'm not clear on where this event is.

    If/when you want to submit your form, the SubmitForm() function is appropriate.  However, if you have something in the OnSuccess event for your form, then that could be your culprit (e.g. Patch()).  One thing to ensure you do is that after a form is submitted, you change a variable that changes the state of the form that blocks future submission (e.g. Set(gSubmitted,true)) and queries against that before you Submit.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @AlexDarrow ,

    Do you wan to submit a new form data into your SP list, and update the first item of your SP List with the new submitted record?

     

    Based on the needs that you mentioned, I think the Patch function could achieve your needs. I have made a test on my side, please take a try with the following workaround:9.JPG

    Set the OnSuccess property of the SharePointForm1 (Edit form) to following formula:

    Patch(
    'YourSPList',
    First('YourSPList'), /* <-- Retrieve the first List Item in your SP list */
    {
    Column1: SharePointForm1.LastSubmit.Column1,
    Column2: SharePointForm1.LastSubmit.Column2,
    Column3: SharePointForm1.LastSubmit.Column3,
    ...
    }
    ); ResetForm(SharePointForm1);
    RequestHide()

    Or

    Set the OnSave property of the SharePointIntegration control to following:

    Patch( /* <-- Modify your first List Item with the new submitted record */
     'YourSPList',
     First('YourSPList'),
     {
     Column1: SharePointForm1.Updates.Column1,
      Column2: SharePointForm1.Updates.Column2,
     Column3: SharePointForm1.Updates.Column3,
     ...
     }
    );
    SubmitForm(SharePointForm1)

    Note: The Column1, Column2, Column3, ... represents the columns in your SP list.

    Please consider take a try with above solution, then check if the issue is solved

     

    Best regards,

  • AlexDarrow Profile Picture
    10 on at
    I have updated the post with some more details and have attached the image. I have used SubmitForm() on the OnSave Function. My OnSuccess Function is not updating or creating new item in the same list
  • AlexDarrow Profile Picture
    10 on at

    No I just want to submit new form data to create new item. I don't want to update any other item on new form.

     

    PS: Thanks for the sample demo.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @AlexDarrow ,

    Do you mean that the first item in your SP list would also be updated when you submit a new record into your SP list>

     

    Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. As an fixed solution, please consider remove the the custom form from your SP list, then re-create a new one for it using PowerApps, then run the custom form again, check if the issue is solved.

     

    Best regards,

  • AlexDarrow Profile Picture
    10 on at

    As I have already mentioned this issue occurs rarely. It has occured 2 times out of 50.

     

    Removing and re-creating form will consume too much time as the form is little bit complex. But If I didn't find any solution then I have to do it.

     

    Thanks for the help Smiley Happy

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @AlexDarrow ,

    You could also consider take a try to restore your custom form app to previous version, then check if the issue still exits.

     

    More details about restoring PowerApps app to previous version, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/restore-an-app

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @AlexDarrow how are you progressing with this?

     

    @Anonymous 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard