Skip to content

Templater (Javascript?) selecting tag not working #1542

Answered by Zachatoo
johnmcd88 asked this question in Help
Discussion options

You must be logged in to vote

Change this line

const selectedTag = (await tp.system.suggester(t => t[0], electronicsTags)[0]);

to this

const selectedTag = (await tp.system.suggester(t => t[0], electronicsTags))[0];

Also, because I think you'll run into this soon, you should use whitespace control to ensure the frontmatter is properly parsed by Obsidian.

<%*
// your block of code here, notice the -%> instead of %>
-%>
---
tags:
  - <% selectedTag %>
Manufacturer:  <% manufacturer %>
Model: <% model %>
Charging Type: 
OS: 
Updated: 
---

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@johnmcd88
Comment options

Answer selected by johnmcd88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants