Mark

If it helps this how I conceptualise the each operator working
[tag[Task]each[context]get[context]]


   - [tag[Task] Get a list of all tiddlers with the tag task
   - each[context] For all these tiddlers that has the context field, get a 
   tiddler title of a tiddler, that represents *each unique *value in the 
   context field.
   - get[context] Since each title generated has a unique context using get 
   will return that value in the context field.


You could say that "each" returns a / any, "but only one" tiddler title, of 
each value in the "context".

Each is a great way to get all previously used values in a field (after 
deduplication)

I like it when others share their "conceptual" understanding, so thought I 
would do so for this one.

Hope it helps

Regards
Tony

On Tuesday, April 7, 2020 at 3:23:30 AM UTC+10, Mark S. wrote:
>
> This finds your unique contexts, puts them in the variable "item", and 
> lists them:
>
> <$list filter="[tag[Task]each[context]get[context]]" variable="item">
>  <<item>> <br/>
> </$list>
>
> The "each" operator removes duplicates. The "get" operator gets the value. 
> I've never really understood why "each" comes before "get", but that is the 
> recipe you find at tiddlywiki.com.
>
> HTH
>
> On Monday, April 6, 2020 at 8:37:48 AM UTC-7, David wrote:
>>
>> I have a bunch of tiddlers with the tag of "Task" and a field called 
>> "context" 
>>
>> I'd like to loop over them, or whatever, and end up with a variable or 
>> tiddler that is a list of all the different values found in that "context" 
>> field.
>>
>> I then plan to loop over that and show some stuff.  Right now, that list 
>> is static and manually created by me.
>>
>> I don't know if there is a command to do it efficiently, or if a loop is 
>> necessary.
>>
>> For example... if tiddlers look like...
>>
>> Name/Title    | Context (Field)
>> --------------|--------------------------------------
>> Clean Gutters | Home
>> Wash Car      | Home
>> Call School   | Work
>> Buy bolts     | Out
>>
>>
>> Then it should save "Home Work Out" into a variable or tiddler.  I guess 
>> variable would be best, if possible.
>>
>> Here is some code to loop over the tag in question, and this transclude 
>> command outputs the context, but of course, there are repeats (which I 
>> don't want).  And of course, this doesn't save it to a variable.  But maybe 
>> it's a good start?
>>
>> <$list filter="[tag[Task]]" variable="item">
>>  <$transclude tiddler=<<item>> field="context" />
>> </$list>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/21543930-0837-4867-87e4-9e6c0f1b7b28%40googlegroups.com.

Reply via email to