Thatâs not a problem, that is exactly, to me the point of the forum, to help explain 
OK, yes, thatâs in ytyou code but the agent action where this occurs actually defines vDate over four lines. This is from your TBX and this:
vDatePath = "/";
vDatePath += "/" + $Created.format("y");
vDatePath += "/" + $Created.format("MM, y");
vDatePath += "/" + $Created.format("MM d, y");
could be re-written as:
vDatePath = "/"+"/"+$Created.format("y")+"/"+$Created.format("MM, y")+"/"+$Created.format("MM d, y");
So the vDatePath +=
part is simply a shorter way of writing vDatePath = vDatePath +
. IOW we are a_adding_ more (test) to the value of vDate.
So your agent action, if a noteâs $Created date is 5th February 2023, vDatePath is:
vDatePath = "/"+"/"+"2023"+"/"+"April, 2023"+"/"+"April 5, 2023";
i.e. a string result of "//2023/April, 2023/April 5, 2023"
One obvious error is an extra â/â has sneaked in. But were you wanting:
"/2023/April, 2023/April 5, 2023"
or
"/Journal/2023/April, 2023/April 5, 2023"
or something else?
The âPinnedâ agent works as expected. So the next question is which notes are you trying to archive? Iâll take a guess you want to archive only pinned notes. To do that, the âJournal creation agentâ agent query becomes this:
descendedFrom(/Notes) & $Pinned==true & $IsArchived==false
If you want to find pinned notes anywhere the query is:
$Pinned==true & $IsArchived==false
And the agent action becomes (assuming weâre still using the /Journal branch of the document for storing aliases:
var:string vDatePath;
vDatePath = "/Journal"; //altered code
vDatePath += "/" + $Created.format("y");
vDatePath += "/" + $Created.format("MM, y");
vDatePath += "/" + $Created.format("MM d, y");
create(vDatePath);
$Container = vDatePath;
$IsArchived=true;
$Pinned = false; //new code
This TBX Journal maker-cz2ed.tbx (327.0 KB) uses the latter of the two amended agent queries and the revised action. Using it, the note âAnother Noteâ at outline root and when $Pinned is ticked is detected, archived and $Pinned switched to false
(un-ticked).
Does this help?