cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Connor551
Resolver I
Resolver I

Image loading time

I'm trying to preload all of my media for this app.  Currently, when I open the app it doesn't load all the media before opening - my screens will be missing images / media for a few seconds.  

I'm trying to create a local cache of these images, but it's not working - am I doing something wrong?  How have you guys solved this?

Screen Shot 2020-05-11 at 11.54.27 AM.png

1 ACCEPTED SOLUTION

Accepted Solutions

HI @Connor551 ,

Do you want to load all of the media before running your app?

Do you reference the media file from the collection rather than reference it directly?

 

Please consider take a try to turn off the "Use non-blocking OnStart Rule" option within Advanced settings of App settings of your app, then re-publish and re-load your canvas app, then check if the issue is solved.

1.JPG

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
sayyed007amir
Resolver II
Resolver II

If you uploaded these images in Media, then you don't need to ClearCollect, Loaddata or Savadata . So please directly reference images with their names.

v-xida-msft
Community Support
Community Support

Hi @Connor551 ,

Do you upload these media files into your canvas app through the "Media" feature?

 

The SaveData function and LoadData function is mainly used for achieving Offline functionality in canvas app. If you have uploaded these media files into your canvas app, these media files would be stored in app's memory. You could reference these media files in your canvas app directly without saving it into your local device cache.

 

If you want to achieve Offline functionality for your canvas app based on these media files. I think there is something wrong with the formula you provided within the OnStart property of App.

Please set the OnStart property of App to following:

LoadData(colPicturesCache, "MediaCache", true)

Add a button (called "Cache to device") in your canvas app, set the OnSelect property to following:

ClearCollect(
            colPicturesCache,
            {Image: '210912'},
            {Image: 'Credubly Logo'},
            ...
            ...
            {Image: '59-592550_photo-ring-contact-conversation-handset-svg-png-transparent'}
);
SaveData(colPicturesCache, "MediaCache")

when your canvas app is in Offline Mode, if you press above "Cache to device" button, it would cache the media files into your local device. Then when re-load your canvas app, the cached media files would be loaded into the colPicturesCache collection again.

 

More details about creating Offline functionality canvas app, please check the following blog or article:

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

https://blog.atwork.at/post/Working-Offline-with-PowerApps

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msft thanks for the reply!

I did use the media upload with these.

I think I see what you're saying.  I don't need offline capability for this.  My issue is the app will start before it's loaded all of the media. 

For example, on my first page, my main logo image will take an extra 3-5 seconds to appear on the screen once the app is open.

HI @Connor551 ,

Do you want to load all of the media before running your app?

Do you reference the media file from the collection rather than reference it directly?

 

Please consider take a try to turn off the "Use non-blocking OnStart Rule" option within Advanced settings of App settings of your app, then re-publish and re-load your canvas app, then check if the issue is solved.

1.JPG

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,863)