Export data from database in CSV then import CSV into database

Hi everyone. I’ve been searching an easy way to export data from database in CSV format and then import data from the same CSV file and fill the database.
I have found the way to write all data into one variable, but couldn’t find the way to save it as a CSV file. Also cannot find the way how to get the text from CSV file into a variable, browse it and import it into database.
Another approach is to create a JSON file but can anyone point to the way of saving JSON file and then import JSON into database.
Any advise is welcomed! Thanks!

Hi zeljko.bobictuw366, welcome to Thunkable! :tada:

Be sure to check out How to ask Great Questions v2.0, the Community Guidelines, and our Getting Started Guide to make the best of your Thunkable Community experience!

While we don’t have a good way of importing CSVs right now, what I would recommend would be to import and export CSV through Google Drive. That way you can connect your Thunkable project to that Google Sheet afterwards.

I wasn’t thinking on google sheets. What about import/export between different databases? This is why I need a solution for saving CSV file (or JSON file) and import the content of CSV file (or JSON file).

It would depend on the database. If you use something like Airtable, I believe it will support import and export as well.

Let me explain a little more. I have stored some info in a local database.
I want to have a backup file in a CSV format (or JSON) to my phone. If I change the phone, I copy this backup file and import it to my app - good to go!
Please point me in the right direction of how to do this. THANKS!

1 Like

While you can download a file, you can not export a file. You will need some medium to make that happen. For example, you could email yourself with the body containing the text of the JSON.

Alternatively, if you use something like Google Sheets or Airtable, since your app is connected to those data sources, even if you switch phones, the app will retain those connections.

Well I already figure that out (email). Now I am confused with other fact???
I am using local database table. After updating or creating a new record, I see my table with new or updated data. BUT, when I close my app and reopen - it shows starting records, like the table has been reinitialized with startup records???
I am using standard blocks - update and create…
What am I doing wrong???
P.S. Maybe changing to “stored datasource” will solve above problem…
Admins - create smart tooltips for important settings!!!

if you use “stored data source” all data in local table will be inside app and when you reopen app you can see it.