Tags:
create new tag
view all tags

Question

After getting help with an EXISTS check within a submit call on HowToGrabHTMLValueInCalc, I've run into another problem where EXISTS does not return what I would expect, this time within a formatted search...

I am trying to produce a report using a formatted search with conditional output, that returns all topics with an associated topic of same name, but with 'ContentValidation' on the end of name. The validation topic reference I use twice in the format section is

%WEB%.$topicContentValidation
I use it once in the EXISTS function, which does not seem to work and once on its own, which does work.

The result is that my EXISTS function always evaluates to false, even when the validation topic exists. Is there a difference in how these topic references are expanded or when? I'd really like to understand the problem, as I hope to use a similar search for other reports. Any advice on another way to achieve same is appreciated.

%SEARCH{"." nosearch="on" nototal="on" format="%CALC{$IF($EXISTS(%WEB%.$topicContentValidation),<nop>, $topic (%WEB%.$topicContentValidation) $n)}%" }%

Sample output of search (I would expect only results with question mark on end of topic in brackets to appear in list):

TeamProjectPresentationMenu (TeamProjectPresentationMenuContentValidation?) 
TestAnnouncementTitle (TestAnnouncementTitleContentValidation?) 
TestTopic (TestTopicContentValidation) 

Environment

TWiki version: TWikiRelease04x00x04
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search

-- MichelleAlbertin - 31 Jul 2007

Answer

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.

is this one of these places where you need to escape the %'s ?

TML evaluation is done inside first, left to right - so unless you escape the %'s in the format (using $percnt ) it will evaluate the %CALC% before it evaluates the %SEARCH%

-- SvenDowideit - 21 Aug 2007

This is correct. Write this: format="$percntCALC{$IF(...)}$percnt"

-- PeterThoeny - 27 Aug 2007

Change status to:
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2007-08-27 - PeterThoeny
 
  • 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.