Dataview table filename shorten?

Hmm, that’s a little tricker, since it sounds like you want to shorten the name but still keep the link clickable. So we need to use FLATTEN and truncate() to construct a link to the page with a shortened name, say 20 characters:

```dataview
TABLE WITHOUT ID
	Link,
	file.mday as Modified
From "Notes"
FLATTEN "[[" + file.path + "|" + truncate(file.name, 20) + "]]" as Link
LIMIT 15
```

Here’s what this query looks like in my vault:

You can change the 20 in the truncate() function to however many characters you like. And of course the LIMIT 15 is just to keep it short; you may want to remove that line for your vault.

3 Likes