I have a wiki where many of the tiddlers have a phone number field (stored as ten digits, no spaces). Most often, there’s a single value in the field. But some tiddlers have two or three values in [[1234567890]] [[0987654321]] format. I’m using <$list filter...> to pull the values, then using <$wikify> to render the resulting list as a variable, which I can pass to an inner filter — with the aim of removing duplicate entries via enlist.
Except — I still have duplicates in the resulting list.
Am I using the enlist operator incorrectly?
Shouldn’t I also be able to accomplish my aim with something like <$list filter="[<phone_history_numbers_wikified>unique[]]? Because that doesn’t seem to work for me, either.
I think I’m missing something that’s staring me in the face … .
—
One (possibly) relevant detail: The reason I wikified <<phone_history_numbers>> was to turn the list of, say:
1234567890
[[2345678901]] [[3456789012]]
[[2345678901]] [[4567890123]]
2345678901
… into a list more like:
1234567890
2345678901
3456789012
2345678901
4567890123
2345678901
… which, of course, I’d like to ultimately look like this:
You can only do the deduplication within a filter run, and typically when you have access to all the things to deduplicate, however the each[] operator can be used for fields, commonly each[fieldname]get[fieldname]
… where I’m getting my first list from the phone_history field of all the tiddlers that match [tag[CN80s]!tag[reports]!has[draft.of]].
I wonder if my use of get is complicating things more than I realize.
But, heck, I may be fundamentally misunderstanding the <$filter> widget, as I’d think my use of [enlist[]]is within the filter run.
If you have any insights to share at your leisure, @TW_Tones, they’ll be appreciated. I’ll likely have to step away for a bit and may not make it back tonight (which might be a good thing!).
The enlist operator also has a dedupe suffix to eliminate duplicates.
You don’t need to use the square brackets if the phone numbers contain no spaces.
You can eliminate the outer list and $wikify by using a $let like so:
Thank you Fred I’ve been ruminating for a week on how to take lists of words within a field keywords and show them in a de-duplicated list so I could have a list of all the keywords I’ve used and this worked beautifully. No telling how many times I searched enlist on tiddlywiki.com and just looked right over enlist-input.