# Dataview -\> extract only matched Line from Page

**URL:** <https://forum.obsidian.md/t/dataview-extract-only-matched-line-from-page/48706>\
**Category:** Help\
**Created:** [December 1, 2022, 4:54pm UTC](https://forum.obsidian.md/t/dataview-extract-only-matched-line-from-page/48706 "2022-12-01T16:54:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![mnvwvnm](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnvwvnm/32/9766_2.png) [@mnvwvnm](https://forum.obsidian.md/u/mnvwvnm)\
**Post date:** [December 1, 2022, 7:38pm UTC](https://forum.obsidian.md/t/dataview-extract-only-matched-line-from-page/48706/5 "2022-12-01T19:38:06Z")

</div>

After the great @holroy focus in tasks, I use lists (same for tasks) as examples of a sub-structure data. Saying it another way: a way to explore metadata in a sub-structure nested in main page metadata structure.

 ![image](https://forum.obsidian.md/uploads/default/original/3X/8/f/8f4e28d663cea419fb1c87a7ae840996af58c877.png)

* * *

## Example note

```md

#work 

## work topics

- (topic:: meeting) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer aliquet eu nibh sed pharetra. (date:: 2022-11-05)
- Aenean eu magna vel nulla vulputate faucibus.
- Donec at interdum mi, a scelerisque lorem. (topic:: client) Ut laoreet turpis enim, nec elementum augue commodo vitae.
- (topic:: meeting) Suspendisse orci augue, ullamcorper eu enim id, sollicitudin tristique risus (date:: 2022-11-07)

```

 ![image](https://forum.obsidian.md/uploads/default/original/3X/a/b/abdd2b44a10d88e9d21a240d996e856b9943523c.png)

* * *

## Exploring queries

Now, as first query, explore the field `topic` as a field at level page:

```sql
TABLE topic, file.lists.text
FROM #work 
WHERE contains(topic, "meeting")

```

As you can see, topic is a key at page level. At this level, filter the topic means filter the page where the field exists.

Now, let’s explore the field `topic` as also a metadata nested in the `file.lists` level. For that we need to flatten the array `file.lists` and add the name `Lists` to the produced objects.  
After that we can explore metadata inside each object.

Fo example, create a table with the text of lists only with the topic `meeting` (observe that now we add the prefix `Lists` - the name used before - to each inline field inside the list text):

```sql
TABLE Lists.text
FROM #work 
WHERE file.lists
FLATTEN file.lists AS Lists
WHERE Lists.topic = "meeting"

```

Or filter the previous results with a specific date:

```sql
TABLE Lists.text
FROM #work 
WHERE file.lists
FLATTEN file.lists AS Lists
WHERE Lists.topic = "meeting"
WHERE Lists.date = date("2022-11-07")

```

* * *

## Results

 ![image](https://forum.obsidian.md/uploads/default/original/3X/4/9/49a2f9491a23ecd7d2389d6823a0015178225624.png)

---

_[View the full topic](https://forum.obsidian.md/t/dataview-extract-only-matched-line-from-page/48706)._
