Question
Hmmm. I'm trying to formulaicly retrieve form data from another topic using the %FORMFIELD... variable as follows:
%FORMFIELD{ "field name" topic="%MYVAR%" format="$value" }%
When I attempt the above, I get:
" format="$value" }%
How do I get the %MYVAR% value to resolve and correctly pass to FORMFIELD?
(Ultimately, I'm trying to retrieve a formfield value from the current topic's parent topic. Maybe there is another way to do this using
FormattedSearch? Any help/hints/pointers would be appreciated.)
--
PaulOpitz - 31 Oct 2005
Environment
--
PaulOpitz - 01 Nov 2005
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
OK. I figured out a way to do this using a formatted search:
%SEARCH{"$parent" format="$formfield(
field to return)" nosearch="on" noheader="on" nosummary="on" nototal="on" expandvariable="on" }%
--
PaulOpitz - 02 Nov 2005
I propose you use a separate topic for your search and include that topic with
%INCLUDE% in your template topic. This allows easier switching of the formfield (just change the
field to return in the created topic).
--
FranzJosefSilli - 02 Nov 2005
AAArg. Just found that the above wasn't really working...was an artifact of having not much data, yet. Now, with more data I'm getting multiple data returns. So, any ideas for limiting the search to only the parent topic? The parent topic's name is always a part of the child topic's name, so I can parse out the parent topic using "%CALC", but I cannot see how to then use this value to limit either SEARCH or FORMFIELD to look only in the parent topic. I need to be able to completely automate child topic creation so that the end user never needs to edit funky TWiki commands.
--
PaulOpitz - 02 Nov 2005
It would be nice if
TopicVarsPlugin worked without unpleasant side effects...
--
AntonAylward - 02 Nov 2005
Well, I finally came up with a search string that does what I need. Falls into the category of "Geez, there's got to be a better way!" but, here goes:
%SEARCH{ "^%BASETOPIC%$" scope="topic" nosearch="on" type="regex" nototal="on" format=" $percntSEARCH{ \".\" topic=\"$parent\" format=\"$dollarformfield(
FIELD TO RETURN)\" nosearch=\"on\" nototal=\"on\" }$nop% " }%
--
PaulOpitz - 02 Nov 2005
Note: your original requirement should be OK in
DakarRelease, when it comes.
--
CrawfordCurrie - 30 Nov 2005