Possible to make one task appear in multiple JS task lists? #1171
Unanswered
DeutscheGabanna
asked this question in
Q&A
Replies: 1 comment
-
You should group by each project individually, rather than all projects. DataviewJS is missing a few utility methods to make this currently easy (I've added const tasks = dv.pages(...);
const groups = {};
for (let task of tasks) {
for (let project of task.projects ?? []) {
if (!(project in groups)) groups[project] = [task];
else groups[project].push(task);
}
}
for (let [project, tasks] of Object.entries(groups)) {
dv.header(4, `[[${project}}]] - _${tasks.length} mention${tasks.length == 1 ? "" : "s"}_`);
dv.taskList(tasks, false);
} That may not quite compile since I didn't dry run it but it should be easy to make work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Consider this JS query:
The problem with this query is that, if a task is assigned to more than one project, it looks like this:

How can I (in JS) attach a task in multiple such groups at once?
Beta Was this translation helpful? Give feedback.
All reactions