Having already seen various ways of exporting, I think the simplest way will be to save a csv file and then send it by email. So the file will be created when the user clicks the "Export Day Data" button or "Export DataBase", and once the user has emailed the file, he will import it on his own into the table view application of his choice.
I would start by saving the file that contains all the data collected (all the tags).
I tried this combination of blocks, but it doesn't work:
Also, this particular app stores different days' readings in different TinyDB NamSpaces, by day (YYYYMMDD?) , so the NameSpace needs to be set before getting the Tag List and doing the extraction.
ok,
...so when I use the block: "list from csv table ... text" I get a file attached to the mail.
Instead, when I use the block: "list to csv table ... list" no file is attached to the mail
What is the problem?
There are several tags with data on my phone; day readings of three months.
For example this is one Namespace (one day reading data) with two tags (two reading sessions data):
Today, with the "...list to table..." block I got my file, but it contains only data of the selected day in my table. That's why yesterday the file was empty.
I should get all the existing tags when clicking "Export Database". How?
I also added the Namespace settings and it seems it makes no difference. Should I keep it or is it enough just "get tags" like above?
Anyway, this or previous combination is perfect for exporting the day data by clicking "Export Day Data" button.
For this option I added a second File component "File2". Is it ok?
And I added also the data title; the date of the exported day (I would need it also when exporting the whole database).
You have made the beginner blunder of over-formatting the internal storage of your data to match how you want it to appear externally in the phone display.
Internal data formats like lists and Instants preserve data values independently of other data values that you might want to mix with them at display times.
The price for the early blunder is to try to recover independent data from each cell of your stored data, usually by splitting each cell at \n, cell by cell.
The data I archived is not real, it was just for testing, so I don't care about recovering the data.
I would like to understand how to fix the blocks so that from now on the data storage can be exported.
So how can I get all tags?
If you want csv format exports, you can't have embedded \n in any cell.
You might try replacing them with '|', cell by cell, before export.
Decide on a date range for you export, using 2 date pickers.
Convert the 2 Instants (from, to) to milliseconds, and loop for each milliseconds from milliseconds1 to milliseconds2 by (number of milliseconds in a day).
In each loop, convert the current milliseconds back to an Instant and format it as a NameSpace value (YYYYMMDD).
Append the exported csv for that TinyDB NameSpace to your out file, day by day.
The "\n" separator in the cell is ok. The wrong display not separating items into columns was just a problem with my Excel.
I opened the file in Google Sheets and it's perfect.
However I think it is useful to save a second file by replacing the column separators from "," to ";" (this works fine) so users can open the file in Excel as well.