Querying from CSV, and unresolved links

So, with a lot of help from the internet, I got a dataview query to work where after getting information from a csv file, the results are clickable wikilinks.

Example codeblock for those interested:

Table WITHOUT ID
"[[" + label + "]]" AS Label,
"[[" + regexreplace(important-to, "\n", "]]<br>[[") + "]]" AS "Important To John",
start-date AS "Begins", 
end-date AS "Ends"
FROM "Timeline.csv"
SORT start-date ASC

WHERE contains(important-to, "John")

It’s great, and should allow me a lot of flexibility with working on a world bible.

The problem is that when there are unresolved links, they aren’t marked as such. I have the Minimal theme, and my Unresolved links are in dark red. My normal links are purple. The links I get in the dataview table are all purple, even if I know they’re unresolved.

Example:

I put brackets around the word ‘Label’ to see if maybe I can add more ways to get to the info I’m querying.

"[[" + label + "]]" AS "[[Label]]"

It works! Except I know I don’t have a page called Label, since I just wrote it with normal wikilinks above that and it’s dark red.

The second image is from Source Mode, where the wikilinks don’t have the theme coloring showing it’s unresolved, but you can also see the code.

I am assuming that therefore the dataview tables and lists are being shown in a similar way to Source Mode, where the theme details about changing color can’t get to it.

Is there any way to adjust that? I love being able to get links to all my pages, but I had assumed I would see the unresolved ones, and so I could therefore add those pages as I go. But to manually check whether there’s a page for each entry would defeat the purpose of easy links.

Try playing around with meta(link(label)), and you’ll see that those not existing yet will fall to have a path ending with .md, IIRC. :‐P

Thank you! That seems to be a step in the right direction! I’ve sort of got it working.

Is there a way to query ‘Where doesn’t contain’? I can manage to then filter out everything that doesn’t have a path- ergo, is an unresolved link.

EDIT: Found it! !contains gives you everything it doesn’t have, woo!

WHERE !contains(meta(link(label)).path, “.md”)

Will give me all of the entries that do not have a metadata file already.

Thank you so much for your help!

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