How to output metadata list from YAML

Things I have tried

I have tried the follow different methods, but neither of them output the data the way I would like it to.

LIST WITHOUT ID entries
WHERE file = this.file

=this.entries

What I’m trying to do

if my yaml array looks like this
entires:

  • a
  • b
  • c

I would like to have the output look like

a

b

c

however if I try the inline method
=this.entries
I get
a,b,c

If i try the LIST method

I get

  • a
  • b
  • c

Could someone assist?

Here’s hoping …

---
entries:
 - cat
 - dog
 - rat
 - log
---

```dataview
TABLE WITHOUT ID entries
WHERE file = this.file
```

Be aware that this do list the entries from the yaml in one row, so if combined with other columns you’ll get those four entries next to single entries.

Then again the OP doesn’t really specify what they’re looking for, so it’s a viable solution with the scarce information given.

It can also be easily modified using FLATTEN to divide into multiple rows.

Agree.

The OP mentions trying to do this inline with a single entry, so I assume they probably don’t need multiple columns. If they do, and if they need extra help …

:woman_technologist::technologist::man_technologist:

1 Like

Could you please give us some more information on your use case? How do you plan to utilise this, and why do you want it that particular output?

Is it supposed to do this dynamically, so that if you change the YAML, the output should also change? Or is it intended for a more static initial start of the note, so that you could later fill in the blanks or in between the various entries?

If you just want a dynamic output of the entries (without posibility to change/add text in the output), you could use dataviewjs to get that exact output. In this scenario, changes to the YAML would also be reflected in the output.

If you want to change/add text afterwards, you could insert a template (using Templater) to produce the wanted output. In this scenario, however, any changes in the YAML will not be reflected unless you re-insert the template (which again could cause earlier changes/addition to be removed).


All in all, you’ll need to add some more details, @millsy013, for us to properly help you reach your goal.

Sorry everyone

Here is the full story. I tried simplifying it to make things easier to understand but I think I made it more complicated.

I have a single JSON script that holds a GIANT list of spells.

I am using the JSON to File plugin and the templator plugin.

I create a single ‘SPELL’ template. This template looks something like this. obsidian spell template - Pastebin.com

At the bottom you can see my attempt using LIST.

it outputs this

I have these lines i’d like to get removed, but Id also like to have more control over each entry.

Things like adding extra lines, or prefixing the lines with text etc.

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