Closed edemko closed 9 months ago
Oof, no comment at all? I was hoping I was just missing something stupid and the issue would just close with an answer.
It's getting real annoying having to remember the magic incantation 😬
Hi, @edemko !
I have a near issues about link text. I found how to resolve from past issues.
link
is treated as object, not string. So I must convert the link to string and use contains
.
This is a separate issue. Using
contains()
on a link is not doing what you probably think it is doing - links are essentially treated as full page objects, socontains(link, "value")
is checking ifvalue
is present as a field on the page being linked to bylink.
Trycontains(string(link), "value")
instead. via: https://github.com/blacksmithgu/obsidian-dataview/issues/2036#issuecomment-1721895152
That's good to know!
In the meantime, I've recently gotten around the problem by learning my way around dataviewjs a bit better, and have actually a more accurate test for my needs anyway (for completeness: dv.pages().filter(p => p.function?.some(x => x.path === dv.current().file.path)
).
Since the other issues are closed, and we've got some workarounds, I'll go ahead and close this one too. Thanks!
@edemko
It's good that you have solved your issue. I am also happy! You're welcome.
I like obsidian. Let's enjoy this application.
What happened?
I am trying to find a list of notes that have a list property that is (well, contains) a given word, but that property is populated by links rather than plain text. (My goal is to auto-generate maps of content based on metadata, if you're curious.)
I found a workaround by enclosing the link in inline code markdown, but I'm honestly surprised that
containsword
does not simply search the markdown string, but instead appears to do something like understand markup and treat links differently.DQL
Not working as expected:
Workaround:
JS
No response
Dataview Version
0.5.60
Obsidian Version
1.4.14
OS
Linux