An approach for a dynamic filter

Player names for a game are each stored in their own dedicated fields.

The filter to get the list of sorted names is not a hard filter to build.

Although I’ll be using a static filter, I wondered how I’d go about using a dynamic filter.

If the filter was assigned to variable “f”, then the list widget would look something like:

<$list filter={{{ [<f>] }}}>
...
</$list>

At the moment, the “Games Manager” tiddler gets a list of players with a filter that statically considers at most five players for a game.

The code in the image:

\define l() =[{!!p
\define r() _🧑}!is[blank]]
\define s() +[sort[]]

<$let f1={{{ [range[1],[12]] +[addprefix<l>] +[addsuffix<r>] [<s>] +[join[ ]] }}}>
''the filter I need:'' <<f1>><br><br>
</$let>

Since variable “f” contains filter syntax, then you can just write:

<$list filter=<<f>>>...</$list>
1 Like