File Picker: how to get/read the content of a JSON file?

Hi Thunkers,

I want implement an app backup/restore function using Json files, like demonstrated by @muneer here.

But I don’t want the user to use the e-email copy & paste strategy, that will expose the structure of my database, besides the complexity of the process for regular users. So the idea is to SAVE a local backup file, and when need restore, LOAD in app the saved file locally.

To save I think the idea in this post can help. But how about the restore?

It’s possible to use the filepicker to get a Json file content and apply it in a variable? This way will be easy to restore.

I tried this,

Captura de tela de 2022-06-25 15-27-42

but not return the file content:

Any idea how to get the file content?

Regards,

Paulo Vaz

1 Like

Have you tried doing get object from json?

look my update on the original post to check what I’m doing…

My question is how to put the content from a .json file stored locally in a variable / label…

Oh! I actually have the same question lol Hopefully we get an answer :wink:

1 Like

Maybe not with filepicker but probably this approach would be helpful:
example2

Obviously instead “set Label1’s Text to response” you can parse content of picked csv file (response) to get exact variable from it.
Hope it will be helpful to achieve what you need.

3 Likes

Fantastic! I never realized that this approach could work for reading the contents of a text file…

These are things that are not officially documented, but should be…

Thanks for the help and congratulations on the knowledge shown!

1 Like

Taking advantage of your answer, I have another need that is to delete local files on the device (of the images that I uploaded via mediaDB to Cloudinary that Thunkable keeps locally but never delete from the device).

Any idea in how to delete local files via Thunkable?

Regards,

Paulo Vaz

1 Like

Unfortunatelly I am not sure if there is some kind of workaround to do so.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.