Dataview query to pull inline fields from list items

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"
\```
1 Like

I’m not entirely sure how sanitised the list fields are, I’ve not looked into properly, but try using item.Quantity and see if that works better.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.