Namespace is set to "call Clock: Now" in the format "yyyyMMdd" and each time I save a tag it is associated with that day's Namespace. And I have to set the Namespace every time I recall the tags of the day.
So if there is no way to retrieve the name of the Namespace, every time I save I could append this tag to the File, as you mentioned? ...but what is the best way to do it in my case?
...but I'm also thinking ...I can't append to File, because the user may have deleted a tag from the table, but it will remain in the File. So another solution is needed.
I just would like to recall all tags, then I will think how to write the day date.
Since the NameSpace values are just dates YYYYMMDD, the Clock component has blocks that can be used to jump forward and backwards in time to generate YYYYMMDD values for all dates in whatever date range you want.
That's why i suggested a From and To Date Picker as one alternative for requesting a range of dates.
Alternatively, you could make a List Picker with options
Last Week
Last Month
Forever
to generate sequences of dates stretching over recent history.
This is a matter of personal taste, and I would not impose such a choice on you.
The File need not be persistent. Since the persistent data is already in the TinyDB NameSpaces, it is cleaner to generate the File contents fresh at each export time, with just the requested range of dates' data.
Could I set date pickers FromDate: January 2022 ToDate: Clock-Now so that automatically when "Export Database" is clicked all the Namespaces (till Now) are called without making the user choose? ...could you show me the blocks?
Because your Blocks Workspace is so bloated I had to work in a separate Screen.
It should be no problem for you to correct component names to match what you have.
Great, it works, ...thanks
The "NameSpaces" variable is necessary? ...I don't see it used in blocks.
Before moving on to data cleaning, I have a question:
In August I reinstalled companion and the data was deleted, but only for August, the data from other months remained on TinyDB.
How does it work?
Right, I missed that.
Glad to see you're reading the code.
It's left over from when I was torn between two different ways of iterating over the different NameSpaces:
generating all of them first in a list, then looping over the list, or
using one of the loop forms (Do While) involving incrementing a value in a range
I ended up choosing the second approach, and forgot I had left a remnant of the first approach.
You can remove that using the blue button and the keyboard delete key. Beware of things popping out of their sockets when you do that.
The storage for the Companion is a garbage can shared across all the apps that have been tested on the Companion. No one cleans it out.
I thought I had developed a little app to browse all the different File scopes available to an app, but I can't find it.
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)
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?:
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)
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.
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:
when I click the button "Clear Tag" the row (HA) is selected (it changes color)