Inline Field Reference with YAML data

Things I have tried

I’ve found several articles from MVNWNVM but none quite addressed my issue…

What I’m trying to do

I’m trying to figure out how to combine inline fields and YAML data.

I have notes for each company I research. [[Company A]], [[Company B]], etc.
And each Company page has various inline fields, such as:

CompanyA
CEO:: Mr. Jones
Industry:: Healthcare
Location:: Rio

I’m trying to create a summary report that will include info on companies as defined in the YAML fields on Summary Page.

Summary Page
(the YAML frontmatter)
Company1: CompanyG

I want the summary report to contain a table for the company(ies) defined in the YAML frontmatter – it should end up looking like the following:

| Company | CompanyG |
| CEO | Mr. Jones |

To get that, I can write the following:

| Company | =this.Company1 |
| CEO | =[[CompanyG]].CEO |

HOWEVER, I can’t figure out how to get the CEO info from the frontmatter, as I’m not able to extract the company name from the YAML frontmatter. (It would involve an inline data reference within another inline data reference!).

=[[=this.Company1]].CEO which clearly doesn’t work. (I ommitted the ` marks here)

I’d greatly appreciate any help/ideas ! Thanks very much.

First clarification: you want a table created by dataview or you want a markdown table created by you with inline queries inside?

Two points:

  1. Dataview table works in different way of your table example: the columns’ title are the key fields and the rows the values // you want the reverse.

  2. It’s more easy to solve if you use the value in Company 1 as a link: Company1: "[[CompanyG]]".

Thx for response, mnvwvnm !
Sorry for lack of clarity - I was creating a markdown table.
And I can easily make the change you describe in point 2 !!

Muito obrigado !

If Company1: "[[CompanyG]]", you can use:

| Company | `=this.Company1.file.name` |
| CEO | `=this.Company1.CEO` |

In company name you can write only this.Company1… but if you want a string instead a link, then use the example above.

It’s also possible to use Company1: CompanyG but the follow method implies you have only one file in your vault with the name “CompanyG”:

| Company | `=this.Company1` |
| CEO | `=link(this.Company1).CEO` |

Once again, you deliver the goods ! Incrivel…em serio. 'brigadao.

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