Joshua,
if one maintains the last item number elsewhere retrieve it and increment/save
its perhaps more efficent. Of course this action needs a trigger so I have
placed it at the beginning of a button that creates the new item.
Another trick is I have used this method to generate a tiddler seri
Hahahah,
You know I had to test that pseudo-example. Here's is the corrected
version. Note that you have to filter the indexes[] result BY SUFFIX
"/Title" to get the correct count. Makes sense now that I see it after
debugging, lol.
<$set name="newRoot" value={{{
[[Test_data.json]indexes[]suf
Hey all!
Awesome to see you experimenting with my tools. There was another use-case
similar to thgis that I cam up with a very interesting trick for. Let me
see if I can find it...
https://groups.google.com/d/msg/tiddlywiki/REBHwjgVALA/7L1gKQ8LBAAJ
The below psuedo-example assumes you have my
Si,
Yes you are very close, I did not think about keeping the key value in the
datatiddler json rather I would have used
value={{{ [{myData!!lastkey}add[1]] }}}
and set myData!!lastkey
No need to have to look into the data to get the last key
Its critical that the button that creates the data
Tony
I'm not sure if I am understanding your suggestion correctly - do you mean
something like this?:
<$edit-text tiddler="$:/state/enter-text" />
<$button>
<$action-setfield $tiddler=myData $index="Key Number" $value={{{
[{myData##Key Number}add[1]] }}} />
<$wikify name=title-value text="<> [
Yeah. That's a good idea.
On Wednesday, November 13, 2019 at 3:32:54 PM UTC-8, TonyM wrote:
>
> Mark perhaps each time you add a tiddler to the data tiddler you increment
> a key number and use it as the key, even in a field on the data tiddler
>
> If you delete a tiddler it will just be a missin
Mark perhaps each time you add a tiddler to the data tiddler you increment
a key number and use it as the key, even in a field on the data tiddler
If you delete a tiddler it will just be a missing key.
If you use a button to add new tiddlers you can make use of the button to
trigger an event to
Joshua's site says that the improved "indexes" filter will return all
paths. So
IF you have the same number of entries for each nested group, then you can
divide by that number and add one to get the next number in the sequence:
<$list filter="[[myData]indexes[]count[]divide[2]add[1]]"
variabl
Since you're writing to the same indexes on the same tiddler, it overwrites
them.
There's no tools in TW for handling nested data tidders, but you can use
Joshua Fontany's JSON Mangler:
https://joshuafontany.github.io/TW5-JsonMangler/
Then you can make $index=level1/Title, $index=level2/Title,
9 matches
Mail list logo