Inline dataview: returning the field value from a dataview querry

Things I have tried

I have atomic daily notes and some more static notes relating to a certain project which im working on. In the daily notes I might have a document with the field refnr:: and LabBook:: The following querry gives me all the LabBook related stuff for the project identified by refnr::

TABLE LabBook as "summary"
from "Diary/daily notes"
where contains(refnr, this.file.link)
sort file.name desc

What I want is to update a field dynamically in the project file called summary:: which is a copy of the latest summary:: found in daily notes.

What I’m trying to do

Im trying to set a field value like this summary:: where the value is the resume of the latest row in the following querry

TABLE LabBook as "resume"
from "Diary/daily notes"
where contains(refnr, this.file.link)
sort file.name desc

A quick question: Are you planning to use the project file’s summary:: field in a further query or is it just for display purposes? Or in other words: does summary in the project file need to be a DV field?

To just display the most recent summary, you could modify the end of your example query to sort by date desc (maybe this is happening already if your filenames are dates) and then use limit 1 to display only the most recent.

Note that this will not work for setting a dataview field in your project file! For that, you’d potentially want to look into the single-line inline DQL or inline dataviewjs, but those don’t show results in Live Preview mode so you might need something more complicated, using a community plugin like metaedit to update your fields.

Thanks for the tips!
I was planning to use the generate value in a different summary table summarizing over all projects while also showing the summary value of the latest daily note pertaining to that project. So yes it needs to be a valid DV field.

Inline dataviewjs seems most obvious to me but Im not sure I can write a query. I will also have a look at metaedit.

1 Like