farling42 / obsidian-import-json

Plug-in for Obsidian.md which will create Notes from JSON files
MIT License
85 stars 5 forks source link

unable to import with a correct Note name #33

Closed seed78 closed 1 year ago

seed78 commented 1 year ago

I attached an .json file in the text format. 4_test.txt

I want to import with the following template .md file to Obsidian.

---
aliases: {{#each items}}{{title}}{{/each}}
---

In "Field to use as Note name", I want to use 'citationKey' in the attached JSON file as my Note name. I got "[object Object]" as the Note name.

How can I make 'citationKey' as my Note name?

Thanks!

farling42 commented 1 year ago

I've just tested it in my Obsidian (v1.1.9) with the plugin version 0.26.0

I had set: "Field containing the data" = "items" "Field to use for Note name" = "citationKey" "Name of Destination Folder in Vault" = "test4"

It created a single note in the test4 folder with a name of "oliveira2021a" as I'd expect - the aliases line had no entries in it.

--

Since citationKey is a field within each entry of the items array, I don't see how you can iterate over that same array within the MD template.

seed78 commented 1 year ago

Thank you for answering! By following your setting, I can import now.