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 / Database Speed for Rem...
Power Apps
Unanswered

Database Speed for Remove() and Patch()

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All

 

Hope you're well!

I currently have a shopping cart application that creates orders and submits them to a shop. Some functionality I included is the ability to create a draft shopping cart where a user can save it, then pick it back up later. The problem I'm having is the speed; I have the cart as a local collection, and when a user saves, it patches into an excel database. To continue, make changes and resave or submit. The application deletes all rows in the database that exists and then patches in the new shopping cart items. I did this since I found it would be the easiest, however, for shopping carts that contain 50 items or more, the Remove() function takes an extremely long time. 

 

So just wondering if I were to switch from an excel connector to CDS or SQL. How much faster will the app be able to remove the rows in the shopping cart? 

 

Or is there another solution to this problem like coding something better. 

Categories:
I have the same question (0)
  • v-monli-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Can you please share all the related formulas here? 

    Also, it seems that you are trying to edit bulk of records from excel table using the collection, but you first delete the existing ones from the excel then add new ones. Actually, you could use one Patch function to directly edit the existing records from the collection.

    For more information about bulk updating, please refer to:

    https://powerapps.microsoft.com/ja-jp/blog/bulk-update-using-forall-and-patch/

     

    For your reference about performance in PowerApps:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/performance-tips

    https://powerapps.microsoft.com/en-us/blog/performance-considerations-with-powerapps/

     

    Regards,

    Mona

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hey @v-monli-msft 

     

    Thanks for the help! 

    So essentially a user creates a shopping cart full of items, and that list contains an 'Order Number', so when a user wants to save it as a draft and complete at a later date. I grab all the items into a list via the order number and Collect them to continue with the order. When the user submits the continued order,then I essentially run RemoveIf(TableData, OrderNumber = TableData.OrderNumber); Then Patch(TableData, Cart);

     

    This was the simplest way I thought would be best so It wouldn't duplicate entries, but I found that Removing rows takes very long. I'll investigate the ForAll() then Patch() and see if its much fast than what I have existing.

     

    But also wanted to ask if it was because of the data source being an excel file and it had limitations of some sort that I didn't know about, and if having a CDS or SQL data source would be faster.

     

    Thanks again!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 538

#2
WarrenBelz Profile Picture

WarrenBelz 420 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard