Slash command to create objects from template

I am trying to create a database of postcards using this template with slash command

---
description: (Template) a yaml snippet with a postcard metadata
tags: meta/template/slash
---

sender: "[[person/|^|]]"
country:
date: ${date.today()}

Which works

sender: "[[person/Friend1]]"
country:
date: 2025-04-18
sender: "[[person/Friend2]]"
country:
date: 2025-04-18

however when I try to query it
${query[[from index.tag “postcard”]]}

I get both friends and the template (since it contains the #postcard yaml). Is there a way to exclude the templaet and keep the actual objects?

ref	tag	sender	country	date	pos	page	itags
postcard_database@167	postcard	Friend2	{}	{}	167	postcard_database	{postcard}
postcard_database@94	postcard	Friend1	{}	{}	94	postcard_database	{postcard}
templates/postcard@99	postcard	^|	{}	${date.today()}	99	templates/postcard

I think the simplest solution for your problem is to tag the template with the #meta tag and exclude meta from your query.

query[[from index.tag “postcard” where not table.includes(tags, "meta")]]}
1 Like

or just ignore when the path (using name or ref) start with templates/

${query[[from index.tag "postcard" where not string.startsWith(name, "templates/")]]}
1 Like

Thank you both! I think it’s a good takeaway to use all table columns (and modify templates to filter on those)