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 / Powerapps creating new...
Power Apps
Unanswered

Powerapps creating new item instead of updating existing item selected

(0) ShareShare
ReportReport
Posted on by 53

Hoping someone can please help me, I have a multi tab form in powerapps and a dashboard that displays the list items created. When I select the form to edit it and make any updates and save it, it then creates a new Item instead of updating the selected item!

Edit button is currently- OnSelect - EditForm(Form1); EditForm(Form2); EditForm(Form3); EditForm(Form4);Navigate(Non Fraud New’,ScreenTransition.Fade)

 

And Submit button is - OnSelect-

‘Patch(

‘Disputes List 2.0’,

Defaults(‘Disputes List 2.0’),

Form1.Updates,

Form2.Updates,

Form3.Updates,

Form4.Updates);

 

Notify(

“data submitted”

Notification type.Success);

 

 

I don’t know what to do I’ve tried everything 

Categories:
  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @Becky2210 ,

    your form is creating a new item instead of updating the existing item because the Patch function is using Defaults('Disputes List 2.0') which creates a new record in the data source. To update an existing item, you need to reference the specific item you want to update.

     

    Ensure you have a variable to store the selected item: When you navigate to the edit screen, set a variable with the item you want to edit. You can do this in the OnSelect property of the gallery or list that displays the items.

     

    Set(varSelectedItem, ThisItem);

     

     

    Edit the EditForm call: Make sure the Item property of each form is set to varSelectedItem.

     

    Form1.Item: varSelectedItem
    Form2.Item: varSelectedItem
    Form3.Item: varSelectedItem
    Form4.Item: varSelectedItem

     

     

    Update the Submit button: Modify the OnSelect property of the submit button to update the existing item rather than creating a new one.

     

    Patch(
     'Disputes List 2.0',
     varSelectedItem, // Reference the selected item to update it
     Form1.Updates,
     Form2.Updates,
     Form3.Updates,
     Form4.Updates
    );
    
    Notify("Data submitted", NotificationType.Success);

     

     

    Here is the revised code for your Edit and Submit buttons:

    Edit Button

     

    Set(varSelectedItem, ThisItem);
    EditForm(Form1);
    EditForm(Form2);
    EditForm(Form3);
    EditForm(Form4);
    Navigate('Non Fraud New', ScreenTransition.Fade);

     

     

    Submit Button

     

    Patch(
     'Disputes List 2.0',
     varSelectedItem, // Reference the selected item to update it
     Form1.Updates,
     Form2.Updates,
     Form3.Updates,
     Form4.Updates
    );
    
    Notify("Data submitted", NotificationType.Success);

     

     


    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.

     

  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    Hello @Becky2210 , 

     

    This is the problem: 

    ‘Patch(

    ‘Disputes List 2.0’,

    Defaults(‘Disputes List 2.0’),

    Form1.Updates,

    Form2.Updates,

    Form3.Updates,

    Form4.Updates); replace it please with this code: 

    SubmitForm(Form1);
    SubmitForm(Form2);
    SubmitForm(Form3);
    SubmitForm(Form4);

    Let me know if it worked.

     

  • Becky2210 Profile Picture
    53 on at

    Thank you so much for your detailed reply. It makes sense however when I try and amend the edit OnSelect and add “

    Set(varSelectedItem, ThisItem);

    I get the following error - Incompatible type. We can’t evaluate your formula because the context variable type are incompatible with the types of values in other places in your app. Name isn’t valid. ‘This item’ isn’t recognised.

     

     

    would be grateful of any extra help!

  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at
    Set(varSelectedItem, GalleryName.Selected);

    change the gallery name accordingly and try this

  • Becky2210 Profile Picture
    53 on at

    Again thanks so much for replying I honestly appreciate it!

     

    im very new to Powerapps and trying to learn but I don’t think I used a gallery to display my items I think I used a table? A table then a tablist to filter on that table?

    IMG_3832.png
  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    Hello @Becky2210 , 

     

    can you please try my solution? you can revert back to how it was and just change your submit button. this should be easier for you. 

     

  • Becky2210 Profile Picture
    53 on at

    No this does not work this just creates 4 new rows in sharepoint  instead of patching them together? 

  • Daniel Bocklandt Profile Picture
    5,151 Super User 2026 Season 1 on at

    What did you  use in the Item property of your Forms? 

    DBO_DV_0-1718174564235.png

     

     

  • Becky2210 Profile Picture
    53 on at

    Table1.Selected

  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    try Table1.Selected in place of gallery.selected in the set variable

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

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard