Creating a list of all Tiddlers that contain a specific sting of text

122 views
Skip to first unread message

Aaron Haslem

unread,
Jan 23, 2020, 6:09:22 PM1/23/20
to TiddlyWiki
Greetings Folks,

I am trying to create a list filter that searches all fields for a specific line of text.
I am creating a maintenance log of over 30 systems.  I created a tiddler for each system.  Each tiddler contains the same set of fields.
field1
field2
field3...

In field1 some systems have 1.0.x ....x is a variable number, some systems have 2.0.x in field 1...etc.

Then, other systems have 1.0.x in field2 rather than field1...

 I want to create a list of all tiddlers that have 1.0.1 in a field.  This could be in field1, field2, or field3.

I would like to list out the tiddler AND the field the 1.0.1 was found in.

I can get AdvancedSearch to return the tiddlers I am looking for by searching for 1.0.1 in the Field Search Bar.

How do I construct a <$list filter=.... that will search all fields for 1.0.1, and then list out the Tiddler and the Field


<$list filter="[fields[]]" variable="fieldname">
<$list filter="[get<fieldname>prefix[1.0.1]]">

This is what is working so far.  I think.  I know that there are 5 tiddlers that contain 1.0.1 in a field.  And I get 5 results in the list, but all 5 results are just 1.0.1 as orphaned links.  No Tiddler Title or the field.  Just 1.0.1.  Since I get 5 results and I know there are 5 tiddlers, I believe the filter is close.  But, how do I get the results to list out the Tiddler and the field name instead of the contents of the field?

Thanks for any assistance you may provide.

Aaron

Mark S.

unread,
Jan 23, 2020, 7:31:35 PM1/23/20
to TiddlyWiki
This is going to take a macro I think to help glue things together. Here's my version:

\define myfilter() [search:$(fieldname)$[$(mysearch)$]]
<$vars mysearch="1.0.1">
<$list filter="[fields[]prefix[field]]" variable="fieldname">
<$list filter=<<myfilter>> >
Found string "<<mysearch>>" in field "<<fieldname>>" in tiddler "<<currentTiddler>>"<br/>
</$list>
</
$list>
</$vars>

which works with the sample text I created.

Note that I used "prefix" to look for "field", so that I wouldn't get back a ton of irrelevant hits (testing on tiddlywiki.com)

Good luck!

Aaron Haslem

unread,
Jan 24, 2020, 2:32:41 PM1/24/20
to TiddlyWiki
Thanks Mark, this is getting close to what I am trying to get.  Is there a way to add a tag filter to this?
Some modifications to your code get me the field and tiddler for the 5 tiddlers that contain the search string 1.0.1 in a field.  Id like to sort this a little more by filtering down to a specific tag.  Each tiddler is tagged with and increment of RX....Tiddler 1 is tagged with R1, Tiddler 2 with R2....etc.

My end goal is a table for each R value.  Table 1 would list all tiddlers that have a field that starts with 1.0. and are tagged with R1.  Table 2 would be the same filter but list out all tiddlers starting with 1.0. and are tagged with R2.  Result being that each Row would be generated from the filter.


Aaron Haslem

unread,
Jan 24, 2020, 3:06:34 PM1/24/20
to TiddlyWiki
by modifications I mean, the prefix[field]  rendered a null set, no results.
prefix[1.] got the 5 tiddlers containing 1.0.1 in a field


Mark S.

unread,
Jan 24, 2020, 4:58:37 PM1/24/20
to TiddlyWiki
It sounds like your tiddlers aren't configured as you described. Perhaps if you posted some of your tiddlers it would be easier to understand.

Good lucK!

Aaron Haslem

unread,
Jan 24, 2020, 5:58:21 PM1/24/20
to TiddlyWiki
Yah.  I was trying to keep the concept simple.  The whole wiki is a maintenance log...bible of sorts.  So the whole wiki is proprietary information I cant share.  And sharing a single tiddler wouldn't tell you alot.  I am using several templates as the interface to each tiddler to display the information in the fields of each tiddler.  This way I only have to update the template in order to add, remove, or rearrange the information.  One change to a template changes all of the tiddlers.

I have 75 pieces of equipment with 10 Input/Output sensors and solenoid valves.  Each Sensor and valve is assigned to 1 of 6 Monitors.  Each Monitor has the same array of I/O modules distributed amongst 4 racks.  So, from a Monitor I can indicate a rack, card, point.  This is the 1.0.01 address.  There are 8 cards per rack, 15 points per card.  Thus, 1.0.01 would point to Rack 1.Card 0.Point 01.  You can kind of see how these addresses become a lot in short order.  6 Monitoring Stations, 4 Racks per Station, ...

(this is only part of the overall information I am tracking in my Tiddlywiki)

To sift through the configuration quickly and arrange the data in whatever way I need to see it, I started using Tiddlywiki.  I like its adaptive nature.

For this adaptatoin. I want to be able to see whats assigned to each point by searching the fields of my tiddlers for a specific point identified by 1.0.01 format. 1.0.00-1.0.14, 1.1.00-1.1.14, ....4.7.14  For each Monitoring Station.

I am assigning the Points at the Specific Equipment Tiddler.  Fields are : Pressure, Door, Temp...etc  A Door Sensor on Equipment01 will trigger an alarm at the Monitoring Station01.  This Door Sensor might be assigned to Rack 4, Card 7, Point 07.
So, in the scheme, this specific door sensor is assigned to Monitor01, Rack4, Card7, Point07.

My Tiddler Title is Equipment01.  It has a Field: Door.  In this Field is the address 4.7.07  Equipment01 is tagged with Monitor01.

I have a Tiddler: Monitor01.  I am trying to build a display of all the Points assigned to it that tells me what Equipment and what sensor has been wired to its Input/Output.  Since the I/O is assigned the address on the Equipment Tiddler, if I could search all fields for 4.7.07 and then display it in a table with all of the other points, I could see where points have been double assigned.  And, I could use the wiki as a reference when the system I/O has been changed. 

In a row on a table I could Identify 4.7.07 in a cell, in the cell next to it I could display the Field Name "Door"  and then the Equipment "Equipment01" based on a search for 4.7.07.
4.7.08, Pressure Equipment01
4.7.09, Temperature Equipment01

I'm trying to avoid double input that can become out of sync with each other.  (my coworkers have several dozen spreadsheets trying to keep track of this information, but they are 2 dimensional and not easily adapted) Meaning, if I update the Point Array and then Update the Equipment Tiddler, I could end up with a Point array on Monitor01 that doesn't match the Equipment01 information.  If I only update the Equipment tiddler, and the information is synced to the Monitor Points display, then the information is synced across my wiki.

Thus, my simplification was in hopes that there was a simple way of searching in fields and then displaying the Field and Tiddler the point was found in.  By creating a tiddler for each Monitor, if I could filter that search down to a tag, I could perform a discreet search for each point and display them in a table for each Monitor.  Once the syntax is down, copy paste replace is fairly quick and simple.
 


Aaron Haslem

unread,
Jan 24, 2020, 6:07:48 PM1/24/20
to TiddlyWiki
So far, from your assistance, this is what I have:

\define myfilter() [!is[system]search:$(fieldname)$[$(mysearch)$]]

1.0.00<br>
<$vars mysearch="1.0.00">
<$list filter="[fields[]prefix[1.]]" variable="fieldname">
<$list filter=<<myfilter>> >
<$link to={{!!title}}>{{!!title}}</$link> "<<fieldname>>" on {{!!1.0.5reghost}} <br/>
</$list>
</$list>
</$vars>

What I get back is:
Equipment01 Door on Monitor01
Equipment07 Door on Monitor03
Equipment11 Door on Monitor04
Equipment23 Door on Monitor02
Equipment51 Door on Monitor05

I'd like it to return by filtering to tag[M01]:
Equipment01 Door on Monitor01


Aaron Haslem

unread,
Jan 28, 2020, 12:28:29 PM1/28/20
to TiddlyWiki
Figured it out.
Since I am making a tiddler for each monitor, placing the tag within the defined macro filters out the results.

\define myfilter() [tag[Monitor1]search:$(fieldname)$[$(mysearch)$]]

<table>
<tr><td>
1.0.00</td><td>

<$vars mysearch="1.0.00">
<$list filter="[fields[]prefix[1.]]" variable="fieldname">
<$list filter=<<myfilter>> >
<$link to={{!!title}}>{{!!title}}</$link> "<<fieldname>>" on {{!!1.0.5reghost}}
</$list>
</$list>
</$vars></td></tr>
<tr><td>
1.0.01</td><td>
<$vars mysearch="1.0.01">

<$list filter="[fields[]prefix[1.]]" variable="fieldname">
<$list filter=<<myfilter>> >
<$link to={{!!title}}>{{!!title}}</$link> "<<fieldname>>" on {{!!1.0.5reghost}}
</$list>
</$list>
</$vars></td></tr>
Reply all
Reply to author
Forward
0 new messages