cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
Highlighted
Super User
Super User

Re: PowerApps SQL connection very slow

@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

Highlighted
Super User
Super User

Re: PowerApps SQL connection very slow

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

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: PowerApps SQL connection very slow

@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

Highlighted
Super User
Super User

Re: PowerApps SQL connection very slow

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

View solution in original post

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,749)