OK so thanks your advice I think I have an idea of what I want to do. I 
must admit I am little confused though.

So here is the template I have created:

Book format: <$select tiddler='$:/book-format'>
<option>Physical book</option>
<option>Audiobook</option>
</$select>


<$button>
<$wikify name=data-tiddler text="$:/data/<<currentTiddler>>" >
<$wikify name=title-value text="<<currentTiddler>> - <<now YYYY/0MM/0DD>>" >
<$action-setfield $tiddler=<<data-tiddler>> $index="Title" 
$value=<<title-value>>/>
<$action-setfield $tiddler=<<data-tiddler>> $index="Format" 
$value={{$:/book-format}}/>
<$action-setfield $tiddler=<<data-tiddler>> $index="Start date" 
$value=<<now YYYY/0MM/0DD>>/>
Start
</$wikify>
</$wikify>
</$button>

<$button>
<$wikify name=data-tiddler text="$:/data/<<currentTiddler>>" >
<$action-setfield $tiddler=<<data-tiddler>> $index="End date" $value=<<now 
YYYY/0MM/0DD>>/>
Finish
</$wikify>
</$button>

With this template I can create a tiddler that represents a book (e.g. "The 
Bible") and add this template. Then every time I read the bible I can 
select the format from the dropdown box, press the "start" button which 
will add the format and the "Start date" to a json tiddler titled 
"$:/data/The Bible", as well as the title "<title> - <date>". The "finish" 
button will add today's date as an "End date" field in the json tiddler.

My main problem is that the data is overwritten every time I press the 
"start" button I want a new data entry every time I press the "start" button

In other words currently I can only  get this:

{
    "Title": "The Bible - 2019/11/01",
    "Format": "Physical book",
    "Start date": "2019/11/01",
    "End date": "2019/11/01"
}


but I want to be able to generate this:

[
{
    "Title": "The Bible - 2019/10/31",
    "Format": "Physical book",
    "Start date": "2019/10/31",
    "End date": "2019/11/01"
},
{
    "Title": "The Bible - 2019/11/01",
    "Format": "Physical book",
    "Start date": "2019/11/01",
    "End date": "2019/11/01"
}



Does this seem like a sensible general approach to what I want to do?

I'm struggling to figure out how to do this from looking at your log tool.

I also want to be able to count the number of entries in the data tiddler 
so I can display how many times I have read the book?

Thank you very much for your help.


On Thursday, October 31, 2019 at 11:27:07 PM UTC, TonyM wrote:
>
> si,
>
> I am not so sure what you are asking here, 
>
>
>> For my problem it seems to me that one option would be to have one 
>> *ADDITIONAL? *tiddler for a *EACH?* book with fields entitled "start", 
>> "finish" and "format", and then each *FIELD?* could contain lists *ie 
>> a LIST FIELD?* where each entry in the list *TIME/DATE STAMP?* 
>> references each time I read the book.
>>
>> If you use a field to contain multiple entries that field can log one 
> after the other, otherwise it typically contains only one value, that gets 
> replaced after update. Yes you can do this and you will need to treat these 
> fields as lists, the time stamp should perhaps be made into a title [[date 
> time]] and you are likely to use the Listops Operators 
> <https://tiddlywiki.com/#Filter%20Operators> and Order Operators.
>
> This is where the log tool instead would place this change in a 
> Datatiddler.. Look for the data tiddler in the log tool to see what I have 
> done. My log tool could be reworked to meet your needs but if your new to 
> tiddlywiki it may not be so simple. The advantage of the log tool is 
> actions on multiple tiddlers are logged in a timeline and can be all seen 
> at once. You could create your own Log buttons for "start", "finish" and 
> "format" that places the time date stamp in the log.
>  
>
>> It sounds like you are saying that this is a bad idea? How would you go 
>> about structuring tiddlers that represent each time that a book is read?
>>
>
> This depends on your ultimate goal, will your data be in a form you can 
> make use of as you wish.
>
> Regards
> Tony
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/43ec4e92-f2f8-4395-a66a-6ce47e9cb1e2%40googlegroups.com.

Reply via email to