This question about Documentation: Answered

Search for other topics that has the same value in a given DataForm field

What I have

All my pages use the same DataForm which contains a field similar to the field Extension in this support web's QuestionForm.

What I want

I want to create a search (for use in a macro) along these lines: show me a list of pages in which the field Extension has the same value as the current topic's field Extension.

I know that I can search for other topics' form values like this:

%SEARCH{ 
type="query" 
"QuestionForm[name='Extension'].value='%TOPIC%'"}%

But the missing piece in this example is that I don't want to search for the current %TOPIC% but rather for the value of a form field attached to the current %TOPIC%.

-- TorbenGB - 14 Jul 2010

Maybe I didn't get your question but I think the following does what you're looking for:
%SEARCH{
type="query"
"QuestionForm[name='Extension'].value='%FORMFIELD{Extension}%'"}%

See System.VarFORMFIELD.

-- MartinKaufmann - 14 Jul 2010

Thank you Martin, I didn't know about the FORMFIELD element. That's a very slick way to put it into a search smile

-- TorbenGB - 19 Jul 2010

QuestionForm edit

Subject Documentation
Version Foswiki 1.0.9
Status Answered
Topic revision: r4 - 21 Dec 2010, TorbenGB
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy