Finding the first child in a container

If I have a container

/Notegroup
Note1
Note2 … etc.

Can I identify the first note (Note1) using action code?

The use case is that I’m trying to build an agent that selects the most recently created note in a container so that I can build a poster from it.

The designator child refers to the first child of a container. lastChild designates the last child. If the container is sorted by$Created, finding the newest or oldest note should be very easy.

If the container isn’t already sorted, we can still do this fairly easily.

var:list kids=$Path(children).sort($Created);
var:string result=kids[0];

Expanding on the above, see: