How to create dataview in-line fields with note links

Hi there,

I am trying to set a way in which I make a log of relevant events for a specific project in my daily note, something like this:

## Log
- 10:17 [project:: [[20230209-ABC]]] [event::some message]
- 10:20 [project:: [[20230209-ABC]]] [event::another]
- 10:21 [project:: [[20230209-ABC]]] [event::another1]

Then in the 20230209-ABC note I would have a log section like this:

TABLE event
FROM "diary/daily"
WHERE project=[[20230209-ABC]]

Things I have tried

I have tried the above and get no results in my dataview query. However, when I missed out a few square brackets by mistake it works unreliably:

## Log
- 10:17 project:: [[20230209-ABC]] [event::some message]
- 10:20 [project:: [[20230209-ABC]]] [event::another]
- 10:21 project:: [[20230209-ABC]] [event::another1]

I assume there is some issue with the brackets and numbers but cannot figure out how to fix it. Help would be appreciated!
Thank you

Hi @arp821, welcome the Obsidian forum!

You’re on the right track, but there’s a wrinkle here – your “project” and “event” fields are attached to your individual list items, not the page itself. The way I would query them is to use the FLATTEN command to create one row per item, e.g.:

- 10:17 [project:: [[Test]]] [event::some message]
- 10:19 [project:: [[OtherPage]]] [event::other event]
- 10:20 [project:: [[Test]]] [event::another]
- 10:21 [project:: [[Test]]] [event::another1]

```dataview
TABLE Item.event as Event
FROM "Inbox" 
FLATTEN file.lists as Item
WHERE Item.project=[[Test]]
```

This looks like this in my vault:

EDIT: Removed page-level project field, not needed.

3 Likes

That worked. Many thanks for quick reply!

1 Like

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