Simple syntax: finding a field where tiddler and field name are variables

I imagine this is simple but that my brains is just not seeing it.

I have a list in which I want to display the value of a dynamically calculated field name. I have stored a reference to the current tiddler in tid and the field name in field. This is not right:

   <td><$text text={{<<tid>>!!<field>>}} /></td>

Nor is this:

    <td><$text text={{<tid>!!<field>}} /></td>

Or this:

    <td><$text text={{{ [<tid>] +[get[<field>]] }}} /></td>

Not a dozen or two other variants I’ve tried. But I assume you can see what I’m trying to do. What syntax trick am I missing this time?

{{{ [<tid>get<field>] }}}

1 Like

Thank you. That was it. I swear that was one I tried, but maybe I forgot to retry it when I fixed a spelling error upstream.

For completness

Just keep in mind that many of the widgets allow you to provide a tiddler and field in their parameters so this is easy even outside filters.

One example of a number is <$view tiddler=<<tid>> field=<<field>>/> for which you get a range of other parameters and features.

  • Another often forgotten approach is using the macrocall widget to call your own macros with a bonus “$output” attribute.

Thank you. I’ve used that before, and should have thought of it. There’s just so much to keep track of!

1 Like

I had posted a related question here — about feeding the <$reveal> widget with a field name stored in a variable — but as soon as I clicked “submit,” I thought it should probably be its own thread and moved it.