cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Meneghino
Level 10

Logical inconsistency? LoadData gives error if app opened for the fist time

If you refer to this post by @csm there seems to be a logical incosistency with the LoadData and SaveData functions that we have not been able to resolve, any ideas are welcome.  Otherwise, as csm suggests, there should be a way to check for the presence of data on the device before calling the LoadData function.

 

Basically, LoadData/SaveData should be used to store user preferences, but if the user is opening the app for the first time or on a new device then this data is not there and an error is given by the first LoadData statement.  You cannot run a SaveData statement first because otherwise it would over-write the stored preferences from a previous session.  (Or at least I have not found a way around that)

8 REPLIES 8
Community Support Team
Community Support Team

Re: Logical inconsistency? LoadData gives error if app opened for the fist time

Hi Meneghino,

 

I found a thread that might answer your question.

https://powerusers.microsoft.com/t5/PowerApps-Forum/load-data-and-sync/td-p/95

 

"Savedata and Loaddata are temporary. If you are looking for a permanent solution, you will want to look into the Update, UpdateIf, and Patch functions. They will record information straight into your Excel tables. 

 

Once information is saved to your tables, you can use Refresh to reload any changes. Changes are automatically reloaded upon closing and opening the app, so you won't need to use Savedata and Loaddata."

 

Also, see the concept of "Savedata ans load data":

The SaveData function stores a collection for later use under a name.

The LoadData function re-loads a collection by name that was previously saved with SaveData. You can't use this function to load a collection from another source.

LoadData doesn't create the collection; the function only fills an existing collection. You must first create the collection with the correct columns by using Collect.

Storage is encrypted and in a private location on the local device, isolated from other users and other apps.

 

https://powerapps.microsoft.com/en-us/tutorials/function-savedata-loaddata/

 

Mona

 

 

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.
Meneghino
Level 10

Re: Logical inconsistency? LoadData gives error if app opened for the fist time

Hi Mona, I believe the intent of SaveData and LoadData is for example to store user preferences on a particular device.

Hence the logical incosistency.

Please refer to this post:https://powerusers.microsoft.com/t5/PowerApps-Forum/Store-user-settings/m-p/13467

Many thanks.

Maverick
Level: Powered On

Re: Logical inconsistency? LoadData gives error if app opened for the fist time

I'm also frustrated by this issue. Seems to me there's two simple solutions:

  1. Add an optional parameter to the LoadData function to error if the file doesn't exist (named something like "ErrorIfFileNotFound"). Default value is true.
  2. Provide a new function to check if a file exists (named something like "FileExists(filename)").

These capabilities have been around since VBScript days. Might be time to dust off some classic ASP...

MarkusR
Level 8

Re: Logical inconsistency? LoadData gives error if app opened for the fist time

for me its a "bug", the savedata get lost after the app is saved in powerapps designer and the app get an update or any other reason.

lets say if me save data, this are my data, no one else touch it.

 

 

 

 

Martha
Level: Power Up

Re: Logical inconsistency? LoadData gives error if app opened for the fist time

It looks like this has been fixed.  When I set the third parameter of the LoadData function to true, it ignores the error.

Povilas
Level: Powered On

Re: Logical inconsistency? LoadData gives error if app opened for the fist time

It looks like the issue is back in newest version and the third parameter (to ignore error if file does not exist) is not in effect...

Stevevater
Level: Powered On

Re: Logical inconsistency? LoadData gives error if app opened for the fist time

Yep just found this on an app thats has true set to ignore errors. It has been running fine for last 6 months, now all of a sudden it has stopped ignoring and generates an error for new users on first access.

 

is there a time line for this to be fixed.????

AlexN
Level 8

Re: Logical inconsistency? LoadData gives error if app opened for the fist time

Still not fix...
The error is very irritating for my users. especially as there is even this extra 3rd paramter just for that.

Using the new "IfError" function doesn't help either, the error is still displayed

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 172 members 5,592 guests
Please welcome our newest community members: