Names of all fields in a tiddler matching a value

43 views
Skip to first unread message

st...@sunypoly.edu

unread,
Mar 24, 2019, 11:59:07 PM3/24/19
to TiddlyWiki
Hi,

I'm sure I've done this before, but...

I need to get a list of all fields in a given tiddler "My Tiddler" that have a value of "XYZ"

Thanks in advance,

//steve.


TonyM

unread,
Mar 25, 2019, 6:53:29 AM3/25/19
to TiddlyWiki
Quick answer

Use [is[current]fields[]] to generate the list of fields in the current tiddler.

Then "get" the value of each fieldname and test it has a prefix and suffix of xyz

Tony

S. S.

unread,
Mar 25, 2019, 9:29:40 AM3/25/19
to TiddlyWiki
Steve

There is definitely a much simpler way, but till someone shows us how, here's one way of doing it:
\define find-in-fields(tid value)
<$list filter="[[$tid$]fields[]] -text" variable="thefield">
<<findvalue tid:"$tid$" value:"$value$">>
</$list>
\end

\define findvalue(tid value)
<$list filter="[[$tid$]field:$(thefield)$[$value$]]">

$(thefield)$ : $value$
</
$list>
\end

<<find-in-fields tid:"My Tiddler" value:XYZ>>

Cheers
Reply all
Reply to author
Forward
0 new messages