Hi,
since I am using Obsidian (about 1 year) I am trying to drive also my complete task management with it.
However, I am not very much satisfied with the Task Plugin as it does not fit really into my eco-system of project management, daily-, weekly notes, etc.
So I started looking into the Plugin Meta Bind, which seems to be quite comfortable (with DB Folder and Metaedit) for task entry and retrieval, update, etc.
However, I am trying to get my head around updating frontmatter by using meta bind.
What I’m trying to do
I included a meta bind input toggle for completion in the template for a task-note - like this:
completed:: INPUT[toggle:completed]
I want to use the status of the input toggle (true/false) as a trigger for the "date of completion: " in the frontmatter.
This is what the frontmatter of my template looks like:
---
fileClass: task
completed: true
date of completion:
---
… and this is the part of the note body with the meta bind code:
```meta-bind-js-view
{Completed} as var_toogle
{dateOfCompletion} as var_date
---
function getFormattedDate(daysToAdd) {
const date = new Date();
date.setDate(date.getDate() + daysToAdd);
return date.toISOString().slice(0, 10);
}
const var_completed = `\`INPUT[toggle:Completed]\``;
const var_date = `\`INPUT[date:dateOfCompletion]\``;
const combinedStr = `${var_completed}\n${var_date}`;
return engine.markdown.create(combinedStr);
I have combined the return as I was not successful keeping it in separate lines, like this:
const var_completed = `\`INPUT[toggle:Completed]\``;
const var_date = `\`INPUT[date:dateOfCompletion]\``;
return engine.markdown.create(var_completed);
return engine.markdown.create(var_date);
The completed toggle gets updated, but not the date of completion.
Things I have tried
I scanned multiple times through the manual and the advanced examples, used Copilot and ChatGPT - but they were also not successful
So, I trust now in the local human swarm intelligence
Thank you for any help!
Greetings
Sven