Question

When my app starts up, I want it to grab the latest changes from Evernote - that is, the changes since it last updated. As part of that process, I want to see what's been moved to the trash recently. Looking at a Note type, it has a created, updated and deleted timestamp.

I went to the NoteStore.findNotesMetadata function, which takes a NoteFilter as an argument. NoteFilter has a NoteSortOrder argument, which is the way in which the notes returned are sorted. NoteSortOrder has the options:

CREATED
UPDATED
RELEVANCE
UPDATE_SEQUENCE_NUMBER
TITLE

There isn't an option to sort notes by date deleted. The date created and modified remain the same as they did before, and so without grabbing the metadata of every note there's ever been, there doesn't seem to be a way for me to see what's been deleted recently.

Any thoughts as to how I could go about sorting by the deleted timestamp?

Was it helpful?

Solution

You will need to get all the metatdata and then sort it. You can use the NotesMetadataResultSpec to limit the amount of data you get. In this case you can set the includeDeleted flag to TRUE, which will only the deleted timestamp of all notes. You can then do another metadata fetch to get the rest of the metadata.

OTHER TIPS

This is not directly related to sort by date deleted. However, I found it to be useful, so I am posting it here.

If you want to control the sort order regardless of when the notes were created or last updates, just put 0., 1., 2., and so on, in front of each note title. That will keep the notes in the order you assign.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top