Accessing Zotero plugin variables in Templater blocks

What I’m trying to do

Extract the firstName, lastName values from the Zotero plugin when it is importing a record. Then, save those values to an array of variables so I can make a new note file whose filename is the “lastName, firstName”. Only create the note if it doesn’t already exist.

I am able to retrieve the imported Zotero values and write them into the frontmatter. However, I cannot retrieve them in a Templater block outside of the frontmatter; the values all come up as null.

The data in the Zotero Data Reader is as follows:
image

Things I have tried

I have tried syntax along the lines of:

let myVar = “{{inputVar}}”;

and

let myVar = {{inputVar}};

but both return nothing.

I am unclear if I am using bad syntax, a bad configuration, a scope/namespace issue, or if this is a limitation of the plug-ins.

I believe it is possible to access these Zotero data as I saw it done in the example at: https://www.youtube.com/watch?v=0hFJw0kEHlU at 11:39 where Bryan Jenks is using the {{title}} variable in a Templater block and setting a local variable to the imported title value.

Any help in solving the issue would be appreciated but also I would be extremely grateful for an explanation of the underlying problem so I can understand the systems better.

Also: what the heck do you all use for debugging? I’ve tried outputting to console.log but I don’t find anything I log in the Developer Console. Boy I am really missing my Visual Studio watches/breaks. :slight_smile:

Thank you!

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