How to build a "dynamic" list ?

78 views
Skip to first unread message

Tony K

unread,
Jun 5, 2020, 5:27:48 AM6/5/20
to TiddlyWiki
I am running a nested filter and looking to get a list of all the results (sorry TonyM I am really trying to explain)

filter 1 gets all tiddlers with a specific tag[DailyNotes]
<$list filter="[tag[DailyNotes]]" >

filter 2 will go over all these results and looking for a specific text pattern
<$list filter="[<currentTiddler>get[text]regexp[$pattern$\b(?i)] 


what I am looking to do is having one list in a variable with all the results of the second filter 

ActionListopsWidget would do it but it is an action and requires a trigger which I do not have in my case

is there a way to do that ?

thanks

Saq Imtiaz

unread,
Jun 5, 2020, 5:33:25 AM6/5/20
to TiddlyWiki
Is there a specific reason why you need nested lists? Do you want the tiddler titles or the text that matches the regexp?

[tag[DailyNotes]regexp[$pattern$\b(?i)]

or

[tag[DailyNotes]regexp:text[$pattern$\b(?)i]

Tony K

unread,
Jun 5, 2020, 5:34:59 AM6/5/20
to TiddlyWiki
no specific reason at all, i just don't know better

will give it a try thanks a bunch 

TonyM

unread,
Jun 5, 2020, 6:07:11 AM6/5/20
to TiddlyWiki
Tony, You did Well, Tony.

  1. It sounds to me like the pattern will remain the same for all items in your final list but you want to access the tiddler name as well in the result.
  2. If you use "get" the value ends up being the title coming out of the list.
  3. SAq's suggestion is applying the reqexp to the titles,  that is not what you want is it, your pattern is running against the text field.
  4. Can you explain why, you are looking to do is having one list in a variable with all the results of the second filter the reason I ask is perhaps there is a way to solve the bigger problem.

I hope I have not appeared to harsh in the past. It takes time to  promote better use of the forums,
the clearer a post is the more we can share; without consuming too much of our own time.

By the way I appreciate your contributions too.

Thanks
Tony

Eric Shulman

unread,
Jun 5, 2020, 6:49:54 AM6/5/20
to tiddl...@googlegroups.com
On Friday, June 5, 2020 at 3:07:11 AM UTC-7, TonyM wrote:

SAq's suggestion is applying the reqexp to the titles,  that is not what you want is it, your pattern is running against the text field.

Saq's second suggestion was:
[tag[DailyNotes]regexp:text[$pattern$\b(?)i]
which *does* apply the regexp to the text field while still yielding the list of matching tiddler titles.
Thus, the above filter would return a list of titles whose text contains the desired text pattern.

Although TonyK's goal wasn't explicitly stated,  I suspect that the above result is what he wants (i.e., find all DailyNotes that contain the matching pattern in their text)

Also, to get the results in a variable, he can use the $set widget, like this:
<$set name="mylist" filter="[tag[DailyNotes]regexp:text[$pattern$\b(?)i]]">

Note that this is one of the specific cases in which the $set widget does something that the $vars widget cannot.  For example, if he were to use an "inline filter" like this:
<$vars mylist={{{ [tag[DailyNotes]regexp:text[$pattern$\b(?)i]] }}}>
then the "mylist" variable would only capture the *first* matching item from the filter.
In contrast, the $set usage captures *all* matching items into the variable.

enjoy,
-e
Reply all
Reply to author
Forward
0 new messages