web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch function deletes...
Power Apps
Unanswered

Patch function deletes data in editable/repeating table (buttons and icons)

(0) ShareShare
ReportReport
Posted on by 8

Hi all. 

 

I'm following Reza Dorrani's tutorial for creating editable/repeating tables here: Power Apps Editable Table/Gallery like Excel (Tutorial) - YouTube. For some reason, whenever I use the patch function with the add row button or delete row button, it will wipe the text already inputted into the table. 

 

Here is my 'add row' button formula. 

 

Patch('Customer Service Task PT. 2',Defaults('Customer Service Task PT. 2'),{Title:"",'Product Code':"",QTY:"",Price:""})

 

 

Here is my 'delete row' bin icon formula

 

Remove('Customer Service Task PT. 2',ThisItem)

 

 

Reza clearly shows that he is able to modify text, add and delete rows live while retaining the remaining text. I believe that it may be due to my data source (SP list) but honestly, I have no idea. Any ideas on what I'm doing wrong?

Please have a look at Image 1 and 2 to see what happens when I click the 'add row' button.

Categories:
I have the same question (0)
  • Chellybean72 Profile Picture
    25 on at

    Hi! I can tell you the trash can is for specifically deleting the row.  For the patch do you have a form you are filling in? 

     

  • turtleshell Profile Picture
    8 on at

    Well I used the Patch function because I was following the YT guide. I have it patching to the data source which is a Sharepoint list. 

  • Chellybean72 Profile Picture
    25 on at

    Try this code:

    The XXXX is your share point list name. I don't use the ' XXX ' just use the name.

    Patch(
    XXXXXX ,
    Defaults(XXXX),
    {
    Title:"",
    ProductCode: "",
    Qty:"",
    Price:""
    }
    )

  • Chellybean72 Profile Picture
    25 on at

    And just to be clear.   The code that is on the trash can is just for deleting rows. It will delete it from the gallery and the share point list. 😊  I am new to power apps. lol just trying to help!! 

  • turtleshell Profile Picture
    8 on at

    Unfortunately, I'm still encountering the same issue. Thanks for trying!

  • Chellybean72 Profile Picture
    25 on at

    What is the error you are getting?  I threw it together and got it to work. Double check your share point list name. 

  • turtleshell Profile Picture
    8 on at

    I'm still getting the issue where when I add a row or delete a row, all the current data inputted into a text input field is wiped. Did you create a repeating table from the Reza video to test it out? That's awesome.

     

    I've attached what my Sharepoint list and repeating table look like. As you can see, it can recognise the number of rows that are currently in the PowerApps repeating table. If you've tested it and it's working, I'm lost on what the underlying problem could be.

  • Suggested answer
    DF-27021330-0 Profile Picture
    6 on at
    I see that this is unanswered.. Here is my solution:
     
     
    Futhermore, now I have to determine if the combobox value was removed with the x, if so, then allow another edit:
     
    ONSELECT:
    Set(varPatchFlag, 1);
    Set(varEntryCount, 1);
     
     
    ONCHANGE:
    If(varEntryCount = 2 && IsBlank(varBeforeManager),
           Set(varPatchFlag, 1);
    );
    If(varPatchFlag = 1,
        If(varEntryCount = 1, Set(varEntryCount, 2), Set(varEntryCount, 0));
    ............... your code here
    );

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard