r3 - 03 Jun 2008 - 00:56:09 - PeterThoenyYou are here: TWiki >  Support Web > ReturnSingleInstanceOfEachFieldValue
Tags:
, create new tag

Question

I'm doing a formfield search to generate a dropdown list of all the possible value of this field, but where a field value occurs on multiple topics, I'm getting multiple hits returned by the search and therefore it appears multiple times in my dropdown list.

Is there a way to ensure the dropdown only contains a single instance of each value, regardless of how many times it occurs?

Here is the search I'm using:

   <form action="%SCRIPTPATH{view}%/%WEB%/%TOPIC%" method="get">
      <select name="fieldvalue">
         <option>Select fieldvalue...</option>
            %SEARCH{ "[F]ield.*value\=.[A-Z].*" web="Foo" type="regex" nosearch="on" nototal="on" format="<option>$formfield(field)   </option>" order="formfield(field)"}%
      </select>
      <input type="submit" value="Go" />
   </form>

Thanks

Environment

TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Forms, Search
-- TamsinTweddell - 18 Apr 2008

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

With the SpreadSheetPlugin, you could try putting the search results into a list and then use the LISTUNIQUE function.

-- SeanCMorgan - 22 Apr 2008

Closing this question after more than 30 days of inactivity. Feel free to re-open if needed.

-- PeterThoeny - 03 Jun 2008

 
Change status to:
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback SourceForge.net Logo