So you’ve probably figured it out now, but in general, {{tiddlerTitle!!fieldName}}
retrieves(transcludes) the field called “fieldName” of the tiddler called “tiddlerTitle”. (And in filters, we use single curly braces to replace the “[” and “]”, as in, {tiddlerTitle!!fieldName}
.) The “!!list” means “get the ‘list’ field”.
There are several ways. I think the simplest is to use the enlist-input operator (mentioned in my initial answer)
In order to take this approach, note that, just like we can use single curly braces “{}” to transclude inside filter expressions, we can use single “<>” to use variables inside filter expressions (where the “<” and “>” replace “[” and “]”). So if you have variables <<targetTiddler>>
and <<tagToAdd>>
, you can use them like this:
<$list filter="[<targetTiddler>get[list]enlist-input[]]">
<$action-listops $tags="[<tagToAdd>]"/>
</$list>
That said, if you are building a form, your text fields (etc.) are bound to tiddlers, not variables. So, most likely, you will not have <<targetTiddler>>
but instead you might have made a tiddler named something like $:/temp/TiddlerNameInputValue
which stores the value you have typed into an edit-text widget. For example, you might have:
<strong>Target Tiddler:</strong><br>
<$edit-text tiddler="$:/temp/TiddlerNameInputValue"/>`
Then the tiddler “$:/temp/TiddlerNameInputValue” will contain whatever you type into that field. So if you typed “My Special Tiddler” into that field, then $:/temp/TiddlerNameInputValue would contain “My Special Tiddler”.
You can do can do the same thing to make a tiddler to store the tag name. I will assume for the example that the tag name will be stored in a tiddler called “$:/temp/TagNameInputValue” (bound to an input field just like the example above).
Then for your actions, you could have:
<$list filter="[{$:/temp/TiddlerNameInputValue}get[list]enlist-input[]]">
<$action-listops $tags="[{$:/temp/TagNameInputValue}]"/>
</$list>
Edit: I had incorrectly written “enlist-inputs” when the filter operator is actually “enlist-input”. Thanks to @tw-FRed for the correction.