I have been working on this, seemingly, simple issue for a few days now without success. Hopefully someone more experience can shed some light on what I’m doing wrong.
In a post from 2021, @saqimtiaz posted a filter string to check for a field being empty.
I want to turn that specific string into a procedure that I can use to check any string.
<!-- IS EMPTY-->
\procedure TLSisempty(myField)
{{{ [<currentTiddler>has:field<myField>] :filter[{!!$(myField)$}trim[]is[blank]then[bobj]] }}}
\end
This is what I have come up with so far but when invoked on a tiddler, say using <<TLSisempty “text”>>in the viewtemplate, it just shows the title of the current tiddler in that tiddler’s text field whether there is any text in the text field or not.
Have tried various combinations of brackets but all to no avail.
I also assume, the filter as written, will return the string ‘bobj’ but I want it to be a boolean result, so the invoking code would look something like
<%if <<TLSemptystring “text”>> %>
do something
<%endif%>
All assistance appreciated so I can sleep at night ![]()
bobj
