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 / Form updates existing ...
Power Apps
Unanswered

Form updates existing Sharepoint List Item instead of creating a new one

(0) ShareShare
ReportReport
Posted on by 17

Hello all, I have an app that is connected to four SharePoint lists, when someone creates an entry in the app, thru the form, it should create new items in all four lists, lately I noticed that sometimes, when an Item is being created it works normally for the first three lists, but in the last one, instead of creating new item, it replaces a random existing one with the data that should be in the new one. This happens in reverse also, I had seen a case where new item had somehow taken information from a random existing item, but it replaced that items title, so it looks like it only replaced some of the data this time,

Forms in the app are completely separate, so there is no option of the form not getting reset or something, also this wouldn't replace only part of the data.

I had a similar issue with the first, main list, but then it got resolved by indexing it and forcing the calculated ID column (ID that my app assigns to the entry upon creation) to have unique values, I did the same for the list that now is problematic but it had no effect.

 

Has anyone had a similar issue? Or does anyone know what could cause this?

Categories:
  • MudassarSZ365 Profile Picture
    591 on at

    Hi @WiktorZaworski ,

    Check Form Mode: Make sure the form is set to New mode (FormMode.New) before submitting. If it’s somehow set to Edit mode, it will update an existing item instead of creating a new one

    Verify Default Values: Ensure no default values are set in the form that might cause it to link to an existing item

    Inspect OnSubmit: Look at the code running when the form is submitted. It should be using FormName.SubmitForm() without any reference to an existing item ID

    Refresh Data: After submitting the form, make sure to refresh your SharePoint list data in the app to prevent old data from caching and causing confusion

    Unique ID Configuration: Since you've mentioned unique IDs, verify that the ID your app generates doesn't accidentally match an existing item's ID, which might cause an update rather than a new entry

    Indexing Lists: While indexing helps with search performance, it doesn't inherently prevent duplicates. Make sure your logic for creating new items is robust

    Review App Variables: Double-check any variables that store item IDs or other identifying information to make sure they’re being cleared or reset properly after each submission.

  • Hassan_SZ_365 Profile Picture
    542 on at

    Hi,

    1. Check Form Submission Settings:

      • Ensure that the form associated with the problematic list is set to create a new item. The DefaultMode of the form should be set to FormMode.New.
    2. Inspect OnSubmit Code:

      • Look at the code that runs when the form is submitted. It should be using a Patch function to create a new item or SubmitForm if it is a standalone form. There should not be any reference to an existing item unless it’s intended to update that item.
    3. Verify SharePoint List Configuration:

      • Check if there are any workflows or Power Automate flows triggered on item creation that might be modifying the list items incorrectly.
    4. Ensure Unique Identifiers:

      • When creating new items, make sure that any ID or unique identifier is truly unique and not accidentally linking to an existing item.
    5. Indexing and Unique Constraints:

      • As you did with the main list, ensure that the SharePoint list is indexed properly and that the fields that need to be unique are set to enforce uniqueness.
    6. Check for Concurrent Users:

      • Determine if the issue occurs when multiple users are submitting data at the same time. This could be causing a race condition leading to data being overwritten.
    7. Form Reset:

      • Even though forms are separate, explicitly reset the form after submission using ResetForm() to ensure it’s in a clean state for the next entry.
    8. Logging for Debugging:

      • Introduce logging within your app to capture the state and data

         

        Best Regards,
        Hassan Raza

  • WiktorZaworski Profile Picture
    17 on at

    All points you've mentioned I've already checked, I'm sure those aren't responsible for this, that's why I'm confused with this whole situation

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 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard