Dataview: Query result from a property

I’m playing around with dataview but I haven’t planned to learn coding yet. This may be the very basic thing in dataview and coding, please help a noob.

I’m using daily notes to track Food and Physical Activity vs Energy, and use dataview in the diary page to have an overview of everything. Here’s two of my input methods in a daily note:

  • foodlog:: / howIfeel:: / meal:: / physicalstate::
  • property “PhysicalActivity” (text): where I add my notes and is used for my heatmap calendar, hence I’m not using the same method

In the diary page, I’m using dataview query as below, it works well for the :: method but now I want to add the property content to this table and don’t know how. Can those two input methods be combined in one table?

```dataview
table meal as Meal, foodlog as "Food & Drink", howIfeel as "How I feel", physicalstate as "Physical State"
from ""
where foodlog 
SORT file.ctime desc

Yes, Dataview treats both frontmatter and inline fields the same way.

If your frontmatter looks like:

---
PhysicalActivity: "Walked twice around the lake"
foodlog: True
---

then you can query it in Dataview as, for example:

```dataview
LIST PhysicalActivity
WHERE foodlog
```
1 Like

Thank you for reminding me about the frontmatter feature, I’ve solved it easily.