Tinderbox Forum

How to identify new notes in an query agent?

I’m using alias to query notes with certain values. Also, I’m adding and importing new notes to my Tinderbox file as I go.

Forgive me if this is a remedial question, but I’m trying to figure out: How can I identify new notes that are captured in agent?

Thank you.

Every note stores the local system time of creation in the attribute Created. It also stores the last modification of title or text in Modified. Both are Date-type attributes.

An agent query of:

$Created > date("today- week")

should find all notes created within the last week. See some considerations when doing date arithmetic.

Don’t want to hardcode the test duration in the query. There’s a way for that too.

Make a new agent and add the built-inDate-type sandbox attribute MyDate as a Displayed Attribute for the agent. Set MYDate to the date after which you want to check. Now the query is:

$Created > $MyDate(agent)

The ‘agent’ part is a designator, which tells the query to test each note’s date value for Created against the agent’s date in its MyDate attribute.

I see. IOW: create a separate agent that would query notes with $Created values to identify newly created or imported notes. Correct?

Another remedial question: Is there any way to create such an agent as child of a parent agent? I’m just trying to see if there’s way to use this to quickly sort wheat from chaff, and it seems like this would provide a solution – if it’s viable – both functionally and within the outline structure we’re using.

Thank you.

Yes. If you want the queery permanently there, use a discrete agent for the role.

No, but only because agents can never be nested. Agents only ever hold the aliases of things matching their query. An agent can nest inside a container, but not another agent.

Can you explain what you mean about this just a bit more? Thank you.

I see. That means I’d have to reconfigure how I’ve structured things.

Thank you.