SID-02248: Exclude topic from a formatted search if formfield is blank
| Status: |
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
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.