For the second solution, I think that the first filter should be simplified to
[has[myField]get[myField]sort[]]
because has assure that each title kept provides a unique value for the field. Am I right?
And for its second filter, how can a filter name (myField) be used as a filter operator? If I understand the intent, [myField<fieldvalue>] would be equivalent to [get[myField]enlist-input[raw]match<fieldValue>]. Am I right in the latter and what is happening with the first syntax, which I can’t make working with tw5.3.1.
The official documentation states that " The syntax of a filter step treats any unrecognised filter operator as if it was the suffix to the field operator., so [myField<fieldvalue>] is a shortcut for [field:myField<fieldvalue>].
See field Operator and field Operator (Examples).
This doesn’t explain why it doesn’t work for you in tw5.3.1 though.
My correction was wrong. My coding should have been:
[each[myField]get[myField]sort[]]
That is, using eeach instead of has. But this has a downside: it produces an empty value for the first tiddler not having the “myfield” field. So to keep the exact functionnality of the original code we should write:
[each[myField]has[myfield]get[myField]sort[]]
and this not any simpler and the intent is less clear. So it’s best to keep the original code.
@tw-FRed It didn’t work for me because I was not looking for the right result.
Your explanations was appreciated, thank you indeed! I’ve tested it and it works. hint: I was looking for a field value instead of a tiddler title! And as for my coding guess, it should have been (along my logic – your code equivalent is way better):
or should it be the simpler code below? From my reading of the “field” operator doc, it should.
:select[get[myField]match<fieldValue>]
myField being a litteral, get[myField] it could be written as {!!myField}.
The conclusion: looking for the solution to my puzzling in the doc was a hard task. That’s given in the “filter step”, and not with emphasis. IMHO, it should be more apprent. And Perhaps we should have entries for common errors.