Tags:
create new tag
view all tags

SID-02248: Exclude topic from a formatted search if formfield is blank

Status: Answered Answered TWiki version: 4.2.4 Perl version:
Category: CategorySearch Server OS: Last update: 9 years ago

I have the following formatted search:

%SEARCH{ "form.name='Treasury.NewBankAccountRequestForm'" 
  type="query"  
  excludetopic="*Template" 
  nonoise="on"  
  header="| *Request Name* | *Requested By:* | *IBG Entity* | *Request Date* | *Date Completed* |"
  format="| [[$topic][$percntICON{newtopic}$percnt]] $topic | $formfield(Requestor) | $formfield(IBGEntity) | $formfield(Date) | $formfield(DateCompleted) |"
}%

I would like to split it into two searches, where first one shows all topics where the DateCompleted is blank. In other words, excludes topics which have value in DateCompleted. The second search should only show topics in which the formfield DateCompleted is populated.

Please let me know how to do this using $IF{"%FORMFIELD{"fieldname"}%=''" then=" " else=" "}

-- Alec Stephanov - 2016-09-08

Discussion and Answer

Do two searches, one with:
"form.name = 'Treasury.NewBankAccountRequestForm' AND DateCompleted = '' "

And the other with:
"form.name = 'Treasury.NewBankAccountRequestForm' AND DateCompleted != '' "

-- Peter Thoeny - 2016-09-11

Peter,

This worked great. I can't believe how simple it is.

Thank you so much,

Alec

-- Alec Stephanov - 2016-09-12

      Change status to:
ALERT! 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.
SupportForm
Status Answered
Title Exclude topic from a formatted search if formfield is blank
SupportCategory CategorySearch
TWiki version 4.2.4
Server OS

Web server

Perl version

Browser & version

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2016-09-12 - AlecStephanov
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.