Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Agent, Actions, Rules & Automation >> Find notes where attribute value is not set
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1407706983

Message started by Ben Worthington on Aug 10th, 2014, 5:43pm

Title: Find notes where attribute value is not set
Post by Ben Worthington on 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

Title: Re: Find notes where attribute value is not set
Post by Mark Anderson on 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).

Title: Re: Find notes where attribute value is not set
Post by Ben Worthington on 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

Title: Re: Find notes where attribute value is not set
Post by Mark Anderson on 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

Title: Re: Find notes where attribute value is not set
Post by Ben Worthington on Aug 11th, 2014, 7:21am

Oh yes.  How long have I been a Tinderbox user?!

Thanks Mark,  as patient and helpful as always.  

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.