Compare Task Outlink to current File Link

Things I have tried

Task in daily journal

  • [ ] [[Link to Person’s note]] text here about the task due:: 2022-10-23

TABLE WITHOUT ID
Tasks.text AS Task,
Tasks.outlinks AS “Outlinks”,
this.file.link AS “Link”
FROM “”
FLATTEN file.tasks AS Tasks
WHERE Tasks.status = " "
WHERE Tasks.outlinks = this.file.link (<- including this line displays zero results)
SORT Tasks.due ASC

Output → No results

What I’m trying to do

Hi,
I have been trying to create a table of tasks created in all files that contains a specific outlink, by comparing that outlink in the task to the note’s current file link where the table is created.

If I leave out the line WHERE i compare oulink to this.file.link, then dataview code listed returns all tasks including tasks without links, and the outlinks match the current file.link.

However, if I add the line, I get no results. I want to compare them so that if I include a person’s note file link in a task, I only want those tasks to appear on the note and not all tasks.

I would appreciate any help with this issue I am having. Thanks.

Edit: included s in code for Tasks.outlinks

I think I have found the answer. Instead of:

WHERE Tasks.outlinks = this.file.link

i tried with the required results:

WHERE contains(Tasks.text, this.file.name)

If anyone has a better way of doing this, please let me know.

you can use WHERE contains(Tasks.outlinks, this.file.link)

The point is: by default, file.tasks.outlinks is an array (outlinks> plural), that’s why you need to use contains, not =.

1 Like

Perfect. I wasn’t aware that it was an array, being a part-time coder. Thanks for the explanation. I appreciate it.

When any doubt about the type, use typeof(field) :slight_smile:

1 Like

Thanks. I’ll keep that in mind.

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