Tinderbox Forum

Collect of an attribute for all notes from root and not a specific container

Is there a way to collect the value for a specific attribute across the entire document and not through a specific folder?

Got it! Just run an agent and then apply an action.

1 Like

values() in its basic form just supplying an attribute name, e.g. values("SomeAttribute") is document-scope. It does de-dupe, but case-insensitively (ant, Ant and ANT would be retained as separate values). As values returns Set-type data, the list is also A-Z, case-sensitively, sorted.

I’m not looking to pull an individual value, but collect all the value from every note of a single attribute into my TBX config. . I got it done with an agent.

That’s what values() does!. :slight_smile: For the given (single) attribute it gets that attribute’s value for every note in the doc as a Set.

Need a list? Then use $collect(all,$Name). See more on the ‘all’ designator. For instance:

Notice the order of occurrence is maintained, aliases are detected, and same-named notes are correctly detected (e.g. ‘bb’, as the process uses the $ID under the hood.

Oh! :person_facepalming:t3: I was thinking ^value()^ not values(). Gotcha! Perfect!!! Also, I as missing the designator “all” I’d not heard of this before.

1 Like

Yes, ‘all’ doesn’t crop up much, but mainly as most times we want less than all, i.e. part of the whole. :rofl:

1 Like