What I’m trying to do
I’m trying to sort a simple table with dataview, here’s my code atm:
const {fieldModifier: f} =
this.app.plugins.plugins["metadata-menu"].api;
dv.table(['Title', 'Reading', 'Author', 'Link', 'Pairing', 'Rating', 'Status', 'Word Count'],
dv.pages("#fic")
.filter(p => !p.file.path.includes('templates'))
.filter(p => !p.file.path.includes('fileClass'))
.sort(p => p.reading)
.map(p => [
//p.file.link,
f(dv,p, "title"),
f(dv, p, "reading"),
f(dv, p, "author"),
f(dv, p, "link"),
f(dv, p, "pairing"),
f(dv, p, "rating"),
f(dv, p, "status"),
f(dv, p, "wordcount")
])
)
It’s not returning any errors, but I want to sort with reverse ascending values so that anything labelled “Finished” is sorted after “To Be Read”. As it is right now it’s sorting alphabetically so the “Finished” value is above the “To Be Read” value.
Things I have tried
I’ll be honest, I’m pretty new to anything beyond Obsidian’s basic utilities, so this is my first foray into js and got the above code from a YouTube video and edited the values for sorting my reading list. I’m hoping the solution is simple, but I don’t really know which part to edit to get it to do what I want to do.