I have a filter that’s working fine in, say, AdvancedSearch, but which doesn’t work if I put it in a template. I can’t figure out why.
If I do this:
[tag[Voter]] :filter[get[first-name]uppercase[]match[FRED]] :filter[get[last-name]uppercase[]match[FLINTSTONE]]
I get the expected result of Voter/28
.
But if i do the following in a tiddler tagged Donation
:
<$let
voter={{{ [tag[Voter]] :filter[get[first-name]uppercase[]match{!!contributor-first-name}] :filter[get[last-name]uppercase[]match{!!contributor-last-name}] }}}
>
<$text text= {{{ [{!!contribution-receipt-date}search-replace:g:regexp[\D],[]addsuffix[000]format:date[MMM DD, YYYY]] }}} />
<% if [<voter>!match[]] %>
<$link to=<<voter>> >{{!!contributor-first-name}} {{!!contributor-last-name}} </$link>
<% else %>
{{!!contributor-first-name}} {{!!contributor-last-name}}
<% endif %>
</$let>
I always get the second branch, without links.
You can see this by downloading the following and dragging it onto the main page.
DonationsTest.json (31.8 KB)
If you open Voter/28
, you can expand Donations
at the bottom and visit one of the donations.
That donation should have a link taking me back to the voter
who made the donation. It doesn’t.
The reason for the two branches is that older donations may have been made by someone no longer resident in town.
Maybe it’s just my sleepy brains, but I can’t see why it would work in one place and not the other.
Any suggestions?