Agent to gather all notes

I’ve had a mind blank. How do I make an agent gather all notes so that I can sort them by date created?

BH

Try $Name!="";

This will search for all notes that have a name, e.g. not equal to nothing.

You can then use the inspector on the agent to sort by date.

image

2 Likes

The subject of the query will be the system Date-type attribute $Created as that stores a notes creation date. Next, you want all notes, so no scoping is required (as in uses a given prototype or is descended from something).

Query:

$Created

Returns all notes with a creation date set. We don’t need to worry about nil values as $Created is unusual in that every item (note, agent, prototype notes, template notes, etc.) must have a creation date. For a date like $StartDate, the same query from would exclude notes with no start date set (“never” is the default for the unset Date data-type).

For the sorting, use the Sort Inspector for the agent (once created). Select the agent and open the Sort Inspector. In the top search box type ‘Created’ and select that attribute from the pop-up. This will sort oldest → newest. If you want the newest → oldest click the ‘reverse’ box next to the sort you just set.