Showing results for 
Search instead for 
Did you mean: 
Level 10

Those of you Using OnPrem SQL - Help with speed

All of my apps rely heavily on sql reading and writing and speed for the user is very slow if using offline capabilities is very slow when patching through a gateway.

I'm writing this to give some quick tips on how to handle this and improve (massively) the speed of your apps.

Reading Data:
If you have to perform filters on big tables this can be slow, one of my apps was taking around a minute to load data into collections). Not ideal.
In order to improve this I have created a list within SharePoint with the same columns, made a flow to collect sql rows overnight into this list with any filters that don't need user input. I can then use this list within powerapps which improves speed as it hasn't got to go through the gateway and get restricted by system resources on the onprem server and also the list is smaller as I've already performed some of the filter I need.

I was getting patch times of over 2 minutes writing back to SQL, especially if there were where clauses on tables of 5k plus rows.
I have now got this down to 10 seconds using this method:
Create a SharePoint list identical to the SQL table you want to patch
Patch everything to this list
Add a flow to do the legwork of updating the on Prem sql table with the SharePoint list data (this takes the load off of powerapps and the user experience)
In the flow Ensure that the list is cleared once the data is uploaded to sql.
You will also have to ensure that the user cannot reload data whilst the flow is running(as there is slight delay), you can get round this in powerapps by checking if the SharePoint list IsEmpty (you could also apply filters if there are writes from multiple people on different data)

I thought this maybe helpful to people as at the end of the day the app has to be quick for the users and no one wants to be waiting.
Community Support Team
Community Support Team

Re: Those of you Using OnPrem SQL - Help with speed

Hi @Delid4ve,


Thanks a lot for your sharing, I believe others who have the similar issue will benefit for your post.




Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level: Powered On

Re: Those of you Using OnPrem SQL - Help with speed

 Do you have a write up or example related to this? I am having trouble with the flow to move from list -> sql table

Level 10

Re: Those of you Using OnPrem SQL - Help with speed

1: Update the sharepoint list from powerapps

2: Add a flow with trigger set to powerapps (you should call this flow in your app code directly after updating the sharepoint list)

3:In your flow:

  • 1st action: Get rows (sharepoint list)
  • 2nd action: Update rows (SQL), select the correct table and then use the fields from the sharepoint list. (this will add an apply to each around the action)

You will probably need to add a condition 1st within the apply to each if you are adding AND updating so it knows whether to add the row or update.


Helpful resources


Power Apps Super User Class of 2020

Check it out!


New Badges

Check it out!


Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,092)