cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fpc-kdrosario
Helper I
Helper I

Error - About cache file not found upon App start

Good day humans,

 

I was trying the app I created which is offline capable using LoadData and SaveData. The app works perfectly when I tested it initially.

 

Now, when I tested it on a new device, there is an error message saying that the file is not found or something. I am suspecting what caused it is the LoadData of the cache file since it is not existing on the device yet because it just downloaded the form.

 

Any ideas on how to handle such error for newly installed form that uses LoadData("cache_file")?

 

Cheers!

 

EDIT:

Here is a snippet of the code (with reservations to ensure confidential data won't be disclosed)

The code below is from the OnStart of the App.

 

ResetForm(EditMainForm);

//Loading Offline Data
LoadData(
    coll_Main_Form,
    "cache_MainForm"
);
LoadData(
    coll_SubForm,
    "cache_SubForm"
);

 

4 REPLIES 4
eka24
Super User III
Super User III

Can you display you formula

Good day @eka24 ,

 

I've edited my main post and included a snippet of my code which is from the OnStart of the App.

 

Cheers!

eka24
Super User III
Super User III

If you are loading the data for the first time on a device without the true parameter, it may throw an error. Try this
//Loading Offline Data
LoadData(
coll_Main_Form,
"cache_MainForm",true
);
LoadData(
coll_SubForm,
"cache_SubForm",true
)

This video explains it further at minute 15:30
https://youtu.be/Q91CtvIqDR0

If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution
PVosEska
Resolver III
Resolver III

Please mark @eka24's response as the answer.

 

Adding the third argument argument as true ignores an empty file.

LoadData(<Collection>,<Filename>,true)

 

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,344)