I’m trying to query inline dataview fields using dataview. I have a field in each line item named “Quantity”. Is there a way to pull this from the text after flattening the list?
I’m hoping to produce a table like this…
File (3) | Weapon | Ammo | Quantity |
---|---|---|---|
[[2025-03-07 - Range]] | [[Glock 17L]] | [[Winchester 9mm Target]] | 221 |
[[2025-03-07 - Range]] | [[Glock 17L]] | [[Critical Defense 9mm]] | 17 |
[[2025-03-07 - Range]] | [[Glock 45]] | [[Critical Defense 9mm]] | 10 |
(For simplicity in debugging and development I’m currently writing the dataview query in the same file as the list. Hence the WHERE file.name = this.file.name
. This query will be moved to a different file later.)
Here is the current markdown…
---
activityType: Range Trip
---
Begin Time:: 2025-09-07 14:30
End Time:: 2025-09-07 15:55
Participants:: [[Bradley Morris]]
Range:: [[US22E-PD]]
## Shot Log
- [[Glock 17L]] [[Winchester 9mm Target]] [Quantity:: 221]
- [[Glock 17L]] [[Critical Defense 9mm]] [Quantity:: 17]
- [[Glock 45]] [[Critical Defense 9mm]] [Quantity:: 10]
## Other List
- just some junk list for testing
```dataview
TABLE
item.text,
item.quantity
WHERE file.name = this.file.name
FLATTEN file.lists AS item
WHERE meta(item.section).subpath = "Shot Log"
\```