cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Load Data - show list of files

Hi All

 

I've built an app that works offline (loads records, does a bunch of stuff, syncs)

 

I've added an option to save data locally to iOS device. Right now the file names are hard-coded. I'd like to name the files with a pattern like username_date. 

 

Is it possible to list the files saved with SaveData?

 

TIA

 

Mark

 

6 REPLIES 6
Highlighted
Community Support
Community Support

Re: Load Data - show list of files

Hi @Mark2457 ,

Could you please share a bit more about your scenario?

Do you want to list the files saved using SaveData function within your iOS device or canvas app?

 

If you want to list the files saved using SaveData function within your iOS device itself, I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you want to list the saved files within your canvas app, I think the LoadData function could achieve your needs. Within your app, you could use LoadData function to load cached data (stored using SaveData function) into a collection, then you could modify the collection data, e.g. rename the file name. After that, save the modified collection into your local device using SaveData function again.

Note: The data stored using SaveData function in your app, could only be loaded using LoadData function.

 

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.
Highlighted
Helper II
Helper II

Re: Load Data - show list of files

thanks for reply. I know how to use LoadData and SaveData. All working fine, but I want save multiple files and show user of files that can be loaded?

 

Regards

 

Mark

Highlighted
Community Support
Community Support

Re: Load Data - show list of files

Hi @Mark2457 ,

Do you want to save multiple files into your local device once time within your app?

 

If you want to save multiple files into your local device once time within your app, I think the Attachments control could achieve your needs.

On your side, you could consider add a Edit form in your app, and add a SP List data source in your app, connect the Edit form to your SP List, then enable "Attachments" field data card in the Edit form, select the Attachments control within the form, then copy it (Ctrl + C), paste it in your other screen of your app. After that, you could use the Attachments control to upload files.

 

Please check and see if the following video resources could help in your scenario:

https://www.youtube.com/watch?v=kQVYid1p_vA

https://www.youtube.com/watch?v=UYK7yruBHDM

 

I have made a test on my side, please consider take a try with the following workaround:

1.JPG

Set the OnSelect property of the "Save" button to following:

ClearCollect(
           FileCollection, 
           ForAll(RenameColumns(FileAttachments.Attachments,"Name","Name1","Value", "Value1"), {FileName: Name1, FileContent: Value1})
);
SaveData(FileCollection, "LocalData")

Set the OnStart property of the App to following:

LoadData(FileCollection, "LocalData", true)

 

Please consider take a try with above solution, check if the issue is solved.

 

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.
Highlighted
Helper II
Helper II

Re: Load Data - show list of files

Hi Kris

 

Thanks for reply

 

Attachments don;t help. I need to save to collections when offline and I want multiple iteration. I can use a dynamic name (username/datatime for example, but it;s no good if I can't show a user the list of files to load

Highlighted
Community Support
Community Support

Re: Load Data - show list of files

Hi @Mark2457 ,

The Attachments control could work when you are Offline (Regardless of whether you are Online or Offline, the Attachments control works well). On your side, if you want to assign a dynamic name for these attached files, please take a try with the following wortkaround:

Set the OnSelect property of the "Save" button to following:

ClearCollect(
           FileCollection, 
           ForAll(RenameColumns(FileAttachments.Attachments,"Name","Name1","Value", "Value1"), {FileName: Text(Now(), "yyyymmddHHmmss") & "_" & Name1, FileContent: Value1}) // Modify formula here, re-assign a dynamic name for these attached files
);
SaveData(FileCollection, "LocalData")

Set the OnStart property of the App to following:

LoadData(FileCollection, "LocalData", true)

 

Please consider take a try with above solution, check if the issue is solved.

 

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.
Highlighted
Helper II
Helper II

Re: Load Data - show list of files

Hi Kris

 

I don;t think you're understanding the issue (or I'm not understanding the proposed solution). I have no attachments and don;t need attachments. i want dynamic names for SaveData and the ability to show the list of files save by save data

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,494)