I have a number of tasks and I’m experimenting with assigning a task to a person and then pulling the task back on whether the assigned field equals the person name.
Things I have tried
I started with:
#task Test 2024-10-25 [assigned::Firstname.surname]
TASK
FROM "TASK FOLDER" AND #task
WHERE assigned = "Firstname.surname"
AND !completed
SORT file.name DESC
GROUP BY section
This pulled back the task I created. However I want the assigned field to also include a link. I created 2 versions of the task. One is the link and the other is a link with an alias:
#task Test 2024-10-25 [assigned::[[Firstname.surname]]]
#task Test 2024-10-25 [assigned::[[Workload Firstname.surname|@Firstname.surname]]]
When I used the dataview query below it didn’t work:
TASK
FROM "TASK FOLDER" AND #task
WHERE contains(assigned, "Firstname.surname")
AND !completed
SORT file.name DESC
GROUP BY section
Unfortunately nothing was returned. Do you know why the query didn’t work?
- [ ] #task Test task 1 ➕2024-10-25 [assigned::[[Firstname.surname]]]
- [ ] #task Test task 2 ➕2024-10-25 [assigned::[[Workload Firstname.surname|@Firstname.surname]]]
```dataview
TASK
FROM "TASK FOLDER" AND #task
WHERE assigned = [[Firstname.surname]]
AND !completed
SORT file.name DESC
GROUP BY section
```
```dataview
TASK
FROM "TASK FOLDER" AND #task
WHERE contains(text, "Firstname.surname")
AND !completed
SORT file.name DESC
GROUP BY section
```
@anon45210282 interesting. So both queries work but return different tasks.
All 3 variations of tasks that I have created were returned with the second. Assume “text” refers to the text for the whole of the task not just the “assigned” variable? How do you use “contains” on the “assigned” variable?
A separate question, but for data integrity, when you create the task is is possible to get the link to come up with options when you create the assigned field?
Assume “text” refers to the text for the whole of the task not just the “assigned” variable?
Yes, as far as I understand things.
How do you use “contains” on the “assigned” variable?
The following works on the simple link, but not on the alias. I don’t know how to get “contains” to work with the alias.
```dataview
TASK
FROM "TASK FOLDER" AND #task
WHERE contains(assigned, [[Firstname.surname]])
AND !completed
SORT file.name DESC
GROUP BY section
```
A separate question, but for data integrity, when you create the task is is possible to get the link to come up with options when you create the assigned field?
That should happen for links automatically wherever they are created: