HI ,
I have a number of tiddlers in a hierarchy , they reference each other in Field1
So tiddler 1 has in field1 the values 2.1, and 2.2 and so forth
I am trying to use the Ancestors filter to do the following
1.for every tiddler go through its hierarchy 1 level up using the reference in field1 , get the contents of the parents text field , then go back to update field1 value with the result
so i want tiddler 1 to go lookup tiddler 2.1, and 2.2 text field value , then go back and overwrite the value of field1 in tiddler 1 with the result
i am using numbers for the tiddler names to help illustrate the hierarchy
- 1
- 2.1
- 2.2
- 3.1
- 3.2
I am using the below code, which works, except when it comes to a fork , it only updates field1 with one of the results( i believe its prob the first result)
<$button>update fields
<$list filter = "[has[field1]]">
<$list filter="[<currentTiddler>ancestors[field1],[1]!title<currentTiddler>get[text]]" variable="gettext">
<$action-setfield field1 =<<gettext >>/>
the example is in https://mighty-soap-71.tiddlyhost.com/
My question is , how do i get this code to update field 1 with multiple values if the tiddler has multiple parents or siblings(depends on how you see it ) .
also how can i add brackets to the results , so if i have 1 or to results, how can i have them both updated in field1 wrapped in double brackets [[]]
thank you for reading all this , and hope it makes sense