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

Speed of transferring pictures

I have built a power app that users can take pictures and they get saved to a local SQL database.  This is all working good, except that some pictures taken are a high resolution which means very large so when you have many of them they can take a while to transfer.  I'm using the "Collect" method to transfer the pictures from a local collection.  I was wondering if the transfer of the images could be done in the background somehow or if there was another way this could be done to speed up the process.  We would like to keep the resolution of the images if possible.  Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

@kidder22 

So some of this gets more into design than anything else.

If you need to deal with disconnected apps, what we do is to store the images locally (along with other data).  If the app is closed, we intercept with the ConfirmExit action on the App and notify that there is data to be uploaded still.  However, even if they close it (or it crashes), the next time we just pull anything stored and then put it back into a collection (we call it a queue) and start the timer.  It just picks up from where it left off.

 

For the Blob storage, we're just using that as a place to store the images.  Although there is ability to add metadata to blob storage, it isn't implemented in PowerApps (or at least it wasn't as of about 6 months ago on our last app that used it).  SO, we name blob images with an identifier that correlates to a table in SQL.  In that table we store the identifier and the metadata needed.

 

Hope that gives you some more ideas.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

@kidder22 

If you can reduce the image size, that would help some.  This can be selected in the PowerApp mobile app settings.

BUT, you mention you would like to keep them.

 

So, if that is the case, one option you can do is to put your Formulas in a Toggle control.  Then use that (tied to some variable you create) to kick it off.  That will then happen "in the background" so to speak.

 

We have a few mobile apps that transfer large amounts of photos taken, although we are using Azure Blob storage for them combined with SQL, all of the formulas for submitting them are behind a Toggle that is elsewhere and hidden.  In our case, we usually have a central timer that fires on a 10 minute period (adjustable) that will (OnTimerEnd) set a global variable (glbSubmitData) to true.  The toggle's Default property is set to (glbSubmitData && Connedtion.Connected) - that way we don't try to transfer if no connection.

Other than the fact that we have a blinking "data" icon on the top of each screen (important for hidden toggles) the user never knows what is going on and continues to use the app while it is happening.

 

I hope this gives you some ideas and is helpful.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thanks Randy, this gives me some options.  One question I do have with your solution is what happens if a user closes the app before your timer kicks in?  Wouldn't you loose the picture?  Or, if the user closed the app in the middle of transferring the pictures?

 

I'm also interested in your solution using Azure Blob storage combined with SQL if you could share how this setup works?

@kidder22 

So some of this gets more into design than anything else.

If you need to deal with disconnected apps, what we do is to store the images locally (along with other data).  If the app is closed, we intercept with the ConfirmExit action on the App and notify that there is data to be uploaded still.  However, even if they close it (or it crashes), the next time we just pull anything stored and then put it back into a collection (we call it a queue) and start the timer.  It just picks up from where it left off.

 

For the Blob storage, we're just using that as a place to store the images.  Although there is ability to add metadata to blob storage, it isn't implemented in PowerApps (or at least it wasn't as of about 6 months ago on our last app that used it).  SO, we name blob images with an identifier that correlates to a table in SQL.  In that table we store the identifier and the metadata needed.

 

Hope that gives you some more ideas.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Thanks again for the response.  It does help.

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,276)