cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hebj1
Frequent Visitor

PowerApps SQL connection very slow

Hi.

We recently added som logging to our PowerApps application to get a better view of how it is working. One thing we finally got hard numbers on was how incredibly slow PowerApps is. We have created an app that handles test protocols. The user fills out a number of records and then hits the save button. It replaces a system of Excel files they used before so it is made to work in a similar way as the spreadsheets where they could manage the hole protocol at once. We implemented this with a gallery that contains three measures for each row. When the user has completed the appropriate changes he/she hits the save button and we use ForAll and a Patch call for each edited row. Now with the logging we can see that it takes approximately one second for each row to be updated. So if the user enters ten rows it will take 10 seconds to save the protocol. Since we can have up to 50 records edited in one go it could take up to one minute to save the changes. Is this normal in PowerApps? Our users are very frustrated with this obviously.

2 ACCEPTED SOLUTIONS

Accepted Solutions
mdevaney
Super User III
Super User III

@Hebj1 
Hello there.  Welcome to our forums 🙂

Yes, the speed is normal.  Using for FORALL + PATCH is a very slow way to update 10 rows. It takes a long time because PowerApps must iterate through the loop and change records one-by-one.

The fastest way is to update the entire table at once.  First put the data into a collection.  Then use PATCH as shown below to update all 10 rows at the same time.

 

ClearCollect(your_collection_name, ???)
Patch(your_datasource_name, your_collection_name)

 

If need assistance, please supply the code you are using that is slow.  I might be able to help you re-write some of it if after you give it a try yourself. 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@TaeZ 
Did I answer your question?  If yes, please come back and Accept As Solution.

View solution in original post

2 REPLIES 2
mdevaney
Super User III
Super User III

@Hebj1 
Hello there.  Welcome to our forums 🙂

Yes, the speed is normal.  Using for FORALL + PATCH is a very slow way to update 10 rows. It takes a long time because PowerApps must iterate through the loop and change records one-by-one.

The fastest way is to update the entire table at once.  First put the data into a collection.  Then use PATCH as shown below to update all 10 rows at the same time.

 

ClearCollect(your_collection_name, ???)
Patch(your_datasource_name, your_collection_name)

 

If need assistance, please supply the code you are using that is slow.  I might be able to help you re-write some of it if after you give it a try yourself. 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@TaeZ 
Did I answer your question?  If yes, please come back and Accept As Solution.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,522)