Kanban Board - tag set to "null"

Hi
strange behaviour - but the mistake is probably on my side :wink:

I have an automated process, which generates a project file and a related Kanban board. Both files have the sames tag in frontmatter defined.
That all works fine!

However, when I am editing the content of the Kanban Board (e.g. adding a card) the tag in frontmatter is set to null :flushed:

I have no idea why. As the file has been generated before, there is no automation anymore and the file contains no dataview, dataviewjs, etc.
However, I am adding a card and the tag will be set to null.

Which is find very odd … unless it is not and I simply don’t understand the logic behind it.

Does somebody have an idea what I am doing wrong?

Thanks!

What is the automated process creating the project note and Kanban note?

Can you share the troublesome Kanban note and/or the Markdown source of it? It will make it easier for folks to get an idea of what’s going on.

1 Like

Thank you @ariehen ,

Yes, of course, you are right - I should have thought of it :wink: Sorry!

So, here is the template file for the project file, which generates both files (please be aware, I am by no means a programmer, and I am certain this can be done much nice and shorter :wink: )

// define variable for input prompt "project description"
	let var_project_description = await tp.system.prompt("project description in one sentence")
	let var_type_project = await tp.system.suggester(["work", "Privat", "B@S"], ["work", "Privat", "B@S"])
	let var_project_status = await tp.system.suggester(["planned", "next", "in process", "comnpleted", "cancelled", "on-hold", "archived"], ["planned", "next", "in process", "comnpleted", "cancelled", "on-hold", "archived"])
	let var_reviewcadence = await tp.system.suggester(["daily", "weekly", "bi-weekly", "monthly", "bi-monthly", "quarerly", "six-months", "yearly"], ["daily", "weekly", "bi-weekly", "monthly", "bi-monthly", "quarerly", "six-months", "yearly"])
	let var_priority = await tp.system.suggester(["top-priority ", "high ", "medium ", "well, yeah ", "get it done, sometime "], ["top-priority ", "high ", "medium ", "well, yeah ", "get it done, sometime "])
	

	// define variable for file name of project template and file name of Kanban Board
	var_titleName = "proj - " + tp.file.title
	var_kanbanName = "KB - " + tp.file.title
	var_tag = "#project-" + var_type_project + "/" + var_titleName.substring(7)
	
	// rename project file based on variable of prior step
	await tp.file.rename(var_titleName)
	
	//define variable for new project directory 
	if (var_type_project == "Privat") {
		var_dir = "2 privat/1 projekte/" + tp.file.title + "/" ;
		}
	else if (var_type_project == "B@S") {
		var_dir = "1 work/1 projects/" + tp.file.title + "/" ;
		}
	else {
		var_dir = "1 work/1 projects/" + tp.file.title + "/" ;
		}
	// if directory does not exist create directory
	if (!tp.file.exists(var_dir)) {
			await this.app.vault.createFolder("var_dir")
	}
	// move project file to project directory
	await tp.file.move(var_dir + var_titleName)
	// create file of kanban board based on template, name it based on variable and move it to project directory
	await tp.file.create_new(tp.file.find_tfile("tmpl kanban"),var_kanbanName,false)
	await tp.file.move(var_dir + var_kanbanName)
-%>

This is then followed by the frontmatter for the project file:

---
project_name: <% var_titleName %>
alias: <% tp.file.title %>
tags: <% var_tag %> 
status: <% var_project_status %>
prio: <% var_priority %>
org: <% var_type_project %>
review_cadence: <% var_reviewcadence %>
reviewed:
project_start: <% tp.date.now("YY-MM-DD") %>
project_filename: <% var_titleName %>
project_kanbanboard: <% var_kanbanName %>
cssClass: minimal_float, wide-page
---

The Kanban file, generated by above looks as follows in the template version

<%*

var_folder = tp.file.folder(true)
var_title = tp.file.title.substring(5)
if (var_folder.includes("work")) {
		var_tags = "#project-work/" + var_title;
	} 
else {
		var_tags = "#project-privat/" + var_title;
	}
-%>
---
kanban-plugin: basic
title: <% tp.file.title %>
tags: <% var_tags %>
Total: 
Incomplete: 
Completed: 
---

## backlog



## todo next



## doing



## done



## archived





%% kanban:settings

{"kanban-plugin":"basic"}

%%

In the note version, when the Kanban file is generated (projectname: Test) it looks in markdown as follows - this contains the correct tag #project-work/Test:

---
kanban-plugin: basic
title: KB - Test
tags: #project-work/Test
Total: 
Incomplete: 
Completed: 
---

## backlog



## todo next



## doing



## done



## archived





%% kanban:settings

{"kanban-plugin":"basic"}

%%

However, after I have entered some tasks ion the board, the tag is set to null

---

kanban-plugin: basic
title: KB - Test
tags: null
Total: 6
Incomplete: 6
Completed: 0

---

## backlog

- [ ] 1
- [ ] 2
- [ ] 3
- [ ] 4
- [ ] 5
- [ ] 6

No idea why …

One thing that stuck out right away was tags: #project-work/Test. Tags in YAML don’t have a #, so that needs to be

tags: project-work/Test

See: https://help.obsidian.md/Editing+and+formatting/Metadata

Looking up a bit, that tag comes from var\_tags = "#project-work/" in the generated template and looking up a bit more, that comes from var\_tag = "#project-" + var\_type\_project in the initial code. I think if you get rid of the #, that will sort out the tags field.

I don’t use kanban much, but there’s a bunch of open issues on their github page. Might be something in there if you’re still getting null after removing the hash tag.

Excellent - thank you! That was the problem!

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