TABLE durationformat(date(now) - file.mtime, "d'd'") + " ago" AS "Modified" , file.folder AS "Path", reviewed AS "Reviewed"
WHERE file.mtime >= (date(today) - dur(7 days))
AND !contains(file.name, "Template")
AND !contains(file.name, "Homepage")
AND !contains(file.name, "Kanban")
AND !contains(file.tags, "#toc")
SORT file.mtime ASC
In the reviewed section it takes a property from my note that has either two values “true” or “false”. How do I change the cell block colour or text based on its value?
In the thread below is a slightly more advanced example where we do multi-coloring related to how many days overdue a task is, but you could use the same principles in your case.
What’s shown there is how to set the class within a cell using <span>, and then using CSS to style the entire cell.
You could also use a simple variant of just presenting the <span> with some color settings, but that would then only affect the actual text within the cell, not the entire cell.
Given the CSS is stored into a snippet, which you’ve enabled, you should be able to replace the last column of yours for reviewed with:
choice(reviewed,
"<span class='cellOK'>OK</span">,
"<span class='cellVERYLATE'>No</span>") as Reviewed
Thank you this helped immensely. However dataview wasn’t reading my true of false values as booleans and it didn’t work. This minor tweak fixed it choice(reviewed = "true", "<span class='cellTrue'>Reviewed</span>", "<span class='cellFalse'>Not Reviewed</span>") AS "Reviewed"
That was a little strange indeed. Are the property type of review checkbox? Or are you setting them manually somehow?
In either case, glad you worked it out, and after I wrote my answer I remembered that I did a larger post related to how you also could use tags to accomplish the same. See thread below:
Using tags one envision doing:
choice(rewiewed = "true", "#_/OK Reviewed", "#_/NotOk Not Reviewed") as Reviewed
It’s matter of preferences, but I just wanted to mention this tag trick, as it can be very useful in some occasiations.