Fixing exporting and clearing my TinyDB data

Well,
I assembled these blocks to clear Day Data and they work.
...for me it is always a nice surprise when something works :slight_smile:

Are they ok? ...or is there any block to improve?

I also assembled the blocks to clear All Data from TinyDB, are they okay?
...is it enough to use just "ClearAll" block?
(other blocks under "ClearAll" are for reloading the table)

How can I test them before clicking the "Clear Data" button?
...once the data is deleted there will be nothing to test :slight_smile:

Also,
is a new notifier required for each notification?

Yes, it is equivalent to looping over all the tags in the current NameSpace and clearing each tag.

Depends on what you mean by "All Data".

All data in one day, or all data from 2022 to current day?

Running an export is a good way to test how well your clearing operation worked.

Only for cases where you need to respond differently to the Okay or Cancel choices, using the matching Event block to handle just that decision.

Are you saying that to clear the selected day's data it is sufficient to set Namespace and to add the "ClearAll" block?
...like this?

...and to delete the data of the whole TinyDB is the "ClearAll" block sufficient?
...like this?
Schermata 2022-09-16 alle 12.13.26

I meant, how can I check what data is going to be cleared by my blocks before clicking the button? ...not after clicking.

I did not understand this, ...can you show the blocks?

Exactly, assuming the global Date contains the selected date.

Clarify what you mean by the whole TinyDB.
Do you have the false belief that the TinyDB component remembers what values it had used for its NameSpace when saving data in different NameSpaces?

No, it doesn't.

I recommend reading the blocks that export all the different NameSpaces' data, to see how a loop over time is necessary for what you might be asking.

This requires a sample app, which requires a separate post, hopefully to follow.

So if I had only stored the tags in the TinyDB, then the "ClearAll" block would be enough to clear all data.
But having grouped my tags into Namespaces, I have to indicate all Namespaces where there are the tags to be cleared.
Is it correct?
These are the right blocks?:

Yes, you got it!
Congratulations!

As promised, here is a sample app which demonstrates the two styles of Notifier use:

  • Single Notifier reused for multiple questions
  • Multiple Notifiers in the Designer, one question each.

The sample app is a dialog asking whether or not to launch World War 3.
(VaultTec is an underground bunker maker from the Bethesda Softworks' Fallout(TM) series)


Notifier_demo.aia (9.8 KB)

Multiple Notifier components in the Designer, with individual events:


Single Notifier reused in an if/then/elseif ladder:


Choosing between these styles is a matter of personal taste.
The Single Designer approach forces the coder to be very explicit in his choice texts, which is a good thing.

Thanks a lot, ...it will probably be useful to me later.
In this case I only have two notifiers, so since it doesn't change much, I let these two components.

How do I start a new line in the notifier message text? ..."\n" doesn't work.

Html

I created the buttons to delete the single tags (rows in table).
It works, but now I realized that it only deletes once. If, after clearing one tag, I select another tag, it doesn't delete it anymore. I have to reload the page to be able to delete another tag.

This is the sequence:

I've already checked and can't find the error, can you help me to understand what is wrong?

I don't understand your persistent failure to set NameSpace before using TinyDB1.

I am also unable to diagnose missing procedures.

I tried to reverse the order (Namespace-TinyDB) but it created a chaos when loading the data.
Here is the file:
Nadi_13.aia (1002.9 KB)

Your project has grown too large to search through.

Please use the right click download blocks option on just the relevant blocks, and on any procedures they call and on any global variable inits used.

Do not edit or clip anything.

Found! ...the "Set Namespace" block was missing
Now it works.

I tried to open the exported csv file in various applications and only Google Sheets reads it well.
Is it true? ...or is there some other suitable application?

All spreadsheet programs look alike, from Excel to Sheets to LibreOffice.
It's all rows and columns.

There are report writers like MS Access (a career killer) you can try.

If you reduce your data export to atomic rows and columns (only one value per cell), you open it up for import into more tools for data visualization.

Google recently posted a new online tool (Data Studio) for data visualization, and there is a lot of help at
https://www.google.com/search?q=google+sheets+visualization

Ah ok, I will always have a displaying problem because of the list in cell.
So I allow to send only one file, the one for Google Sheets, and I give the instructions in the mail message.
Thanks for Data Studio indication.

<br>
This symbol works to wrap text in the Notifier dialog message. Great!

So before clicking the "Clear All Data" button (to check it), could you check all the blocks in my project to see if I can simplify some of them?
This is my last file:
Nadi_14.aia (669.2 KB)

Here is a list of all my demo projects:

Can you read all of them and derive insights from them how to simplify your bloated project?

So exporting and deleting data is fixed.
These are related blocks:

.......... :cherry_blossom: Thank You All! :cherry_blossom:..........

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