Templater or DataviewJS, how to find the latest created file in a folder?

Hello everyone, pretty much the title. I do not mind which of the above plugins I use for this, but I would like to get the object file of the latest create note in a folder. Thank you.

I can suggest dataview (because I don’t know how to work with Templater).
Two examples:

  • dql query
FROM "your/folder/path"
SORT file.ctime DESC
  • inline dvjs query
`$=dv.pages('"your/folder/path"').sort(p => p.file.ctime, 'desc').file.link.limit(1)`

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.