Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Find notes where attribute value is not set (Read 2781 times)
Ben Worthington
Full Member
*
Offline



Posts: 110

Find notes where attribute value is not set
Aug 10th, 2014, 5:43pm
 
I want to find notes that have not been tagged i.e. $Tag is empty.  What is the action code for finding notes with $Tag where $Tag is empty.

Thanks,

Ben
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Find notes where attribute value is not set
Reply #1 - Aug 10th, 2014, 6:13pm
 
Query:   $Tag==""

Or, as action code if() condition:   if($Tag==""){}

The default value of string, lists, set, URL and action type attributes is an empty  string. For completeness: a number type default is 0 (zero) and for boolean type it is false (no quotes).
Back to top
 
« Last Edit: Aug 10th, 2014, 6:15pm by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Ben Worthington
Full Member
*
Offline



Posts: 110

Re: Find notes where attribute value is not set
Reply #2 - Aug 10th, 2014, 6:22pm
 
Thank you Mark.

I am using that but my agent is returning a note with tags.  The full agent code is  $Prototype=="p_case";$Tag=="";

I want to find only notes that have a Prototype of p_case AND no tag.  Any idea what I'm doing wrong?

Many thanks,

Ben
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Find notes where attribute value is not set
Reply #3 - Aug 11th, 2014, 3:50am
 
In queries, you join arguments with an 'and' (ampersand &) or an 'or' (pipe |).

Incorrect query: $Prototype=="p_case";$Tag=="";

Correct query:  $Prototype=="p_case" & $Tag=="";

Whitespace either side of the join is optional, this is also fine:

$Prototype=="p_case"&$Tag=="";

You might also find this article on conditional statements to be helpful
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Ben Worthington
Full Member
*
Offline



Posts: 110

Re: Find notes where attribute value is not set
Reply #4 - Aug 11th, 2014, 7:21am
 
Oh yes.  How long have I been a Tinderbox user?!

Thanks Mark,  as patient and helpful as always.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print