Agent $AgentAction parse error on collect_if(all, ...) — cannot be parsed

TheodoreCRM2026 1.2.tbx (87.1 KB)

Tinderbox 11.6.0, macOS 26.3, Apple M1 Pro

I may have gone way over my skis here, with the help of Claude, in my first major Tinderbox project in more than a year. I’m hoping someone can give me at least a clue about what’s going wrong here. If you want to jump into the TBX document, it’s attached.

I’m building a CRM and need an agent that flags duplicate prospects. The agent finds notes with $Prototype == "ConnectionProspect" in a container called Connections Raw, then checks whether a matching $LinkedInURL exists among notes in a container called Prospects. If a match is found, it sets $DupeTrace to the matching note’s name and $DuplicateFlagto true.

Agent query (accepted without error):

$Prototype == "ConnectionProspect"
& $Container == "Connections Raw"

Agent action (generates parse error):

$DupeTrace = collect_if(all, $Prototype == "ConnectionProspect" & $Container == "Prospects" & $LinkedInURL == $LinkedInURL(this), $Name)[0];
$DuplicateFlag = $DupeTrace != "";

The Errors and Warnings panel shows:

This agent’s $AgentAction cannot be parsed: $DupeTrace = collect_if(all, $Prototype == “ConnectionProspect” & $Container == “Prospects”…

I’ve also tried these variants, all generating the same error:

$DupeTrace = collect_if(find($Prototype == "ConnectionProspect" & $Container == "Prospects"), $LinkedInURL == $LinkedInURL(this), $Name)[0];
$DupeTrace = find($Prototype == "ConnectionProspect" & $Container == "Prospects" & $LinkedInURL == $LinkedInURL(this))[0];
var:string vURL = $LinkedInURL;
$DupeTrace = collect_if(all, $Prototype == "ConnectionProspect" & $Container == "Prospects" & $LinkedInURL == vURL, $Name)[0];

Even this single line fails:

$DuplicateFlag = $DupeTrace != "";

Both DupeTrace (string) and DuplicateFlag (boolean) exist as user attributes. Smart Quotes is off.

Interestingly, a working agent in the same document — Agent 3: Count and Date Maintenance — uses collect(children, ...)successfully. That agent’s scope is limited to children of the notes it finds, so it never needs to reference $LinkedInURL(this) across containers.

My questions:

  1. Is $AttributeName(this) valid inside a collect_if condition in an agent action?

  2. Is collect_if(all, ...) valid in an agent action, or does all cause problems in that context?

  3. What is the correct syntax for looking up a matching attribute value across a separate container from within an agent action?

Any guidance appreciated.

  1. Is $AttributeName(this) valid inside a collect_if condition in an agent action?

Yes. But remember that this is bound to the note being tested, rather than the note that owns the rule. The note that owns the rule is that.

  1. Is collect_if(all, ...) valid in an agent action, or does all cause problems in that context?

Yes, it’s fine. find(expression) is a handy abbreviation for collect_if(all,expression,$Path)

Thank you, Mark!