Structuring CRM data in a note (front matter vs. note content)

Like many here, I link to the various people I meet and interact with so I can use back links to pull meeting notes and other information together. The combination of back links with the dataview plugin make for some interesting possibilities.

Since dataview only looks at fields in the YAML front matter and I can only link to other notes when the links exist outside the front matter, I’m stuck duplicating data or using some combination of the two.

For example, in the person’s note I want to link to the person who connected me with that person:

Introduced by: [[Albert Einstein]]

That linking doesn’t work when it’s in the front matter when I do something like this:

introduced-by: [[Albert Einstein]]

What do your “CRM” person templates look like? Looking for some good starter examples here.

3 Likes

Maybe I’m misunderstanding you, but dataview can use fields within the note (not just the frontmatter) with the syntax Introduced by:: [[Albert Einstein]]

This is my person template:

My people database:

#databases
Area:: Vaults

table Aliases, Birthday, connection-points as "Connection_Points", Profession, Related, shared-interests as "Shared Interests", elink(twitter-account) as "Twitter Account"
from "People"
sort file.mtime desc
4 Likes

Well I’m delighted to be wrong! Thanks for the info. Not sure how I missed that.

I have an open feature request to address this problem: outgoing() in where clause with file.link as the source · Issue #89 · blacksmithgu/obsidian-dataview · GitHub

Would enable behavior like where contains(outgoing(file.link), this.file.link)

I was aware of the YAML vs Name::Value possibilities. But I somehow get Dataview to only work with YAML frontmatter, not with in-note fields. Now I see you write

#databases Area::Vaults

What is the significance of that, and where should it be declared? Thanks in advance!

1 Like

#databases is just a tag in this example.
Area::Vaults is the in-note field::value pair - which should work

Thanks @bobkitz. I asked because somehow I can’t get my Dataview queries to work (0 results) with name::value in the main body of the note, where it does work if the same data is in the YAML frontmatter (—name:value— ), which made me wonder what I’m overlooking.

1 Like

Below is an example template using YAML front matter and Dataview-inspired syntax:

id: UniqueID123
name: John Doe
email: [email protected]
phone: +1 123-456-7890
introducedBy: [[Albert Einstein]]
tags: [Customer, Lead, Important]

Other Fields

company: XYZ Corporation
position: Sales Manager
notes: |
John Doe is a key contact for our upcoming project. Met him during the networking event organized by [[Albert Einstein]].

Meetings

meetings:

  • date: 2023-01-15
    notes: Discussed potential collaboration on Project X.

Opportunities

opportunities:

  • title: Project X Partnership
    status: Pending
    notes: John expressed interest; follow up in two weeks.

Tasks

tasks:

  • description: Follow up on Project X
    due: 2023-02-01
    status: Pending

Custom Fields

customField1: Value1
customField2: Value2