[question] multi-value index DataTiddler

85 views
Skip to first unread message

Tony K

unread,
May 17, 2020, 11:54:46 AM5/17/20
to TiddlyWiki
is there a way to save a list in a DataTiddler? and to add/remove elements to that list?

it might be an obvious question but I didn't figure it out

thanks for the help

Mark S.

unread,
May 17, 2020, 12:16:23 PM5/17/20
to TiddlyWiki
The datatiddler tools we're given only go one level deep. So to encode more than one thing per index you'd need to perhaps pack everything into a string with a designated separator, and then unpack it later as needed.

But in reality, if you find that you're needing to put lots of stuff into a data tiddler, it might be better to consider using tiddlers, which are the real data units of TiddlyWiki. All the widgets and filters are based on tiddlers, with few based on data tiddlers.

Tony K

unread,
May 17, 2020, 12:24:26 PM5/17/20
to TiddlyWiki
Thank you Mark for always answering me :)

I am not really talking about "multi-level" but rather "multi-value"

I am looking at them as a way to manage lists instead of fields 

e.g list1: item1-item2-iteme 

etc...

Mark S.

unread,
May 17, 2020, 1:59:18 PM5/17/20
to TiddlyWiki
You can use the action-listops widget.

So if you have a data tiddler "MyDataTiddler" set up, you can use this:

<$button>
<$action-listops $tiddler="MyDataTiddler" $index="myindex" $subfilter="[list[$:/StoryList]]"/>
Add Items
</$button>

Be aware that if you don't set MyDataTiddler in advance, action-listops will attempt to create it as JSON tiddler. That may or may not be all bad.

Tony K

unread,
May 17, 2020, 2:07:10 PM5/17/20
to TiddlyWiki
interesting ....

Now I need to figure out how to retrieve it as a list 

TonyM

unread,
May 17, 2020, 7:33:22 PM5/17/20
to TiddlyWiki
Tony K

First retrieve is as record via index then enlist it to extract the titles.

Tony

Tony K

unread,
May 18, 2020, 1:19:06 AM5/18/20
to TiddlyWiki
Great thanks for the tip
Reply all
Reply to author
Forward
0 new messages