Dataview table fields causing overflow

What I’m trying to do

I am trying to get my data view to show all the fields in the standard obsidian view. I don’t want to change the obsidian settings to expand the content, because the it expands everything.

Things I have tried

I have tried using the FLATTEN truncate(tags, 20) to truncate a certain row, but its not working. Below is my query:

table categories AS Category, tags AS Type, status AS Status, date AS "Date Created"
from "Inbox"
WHERE !contains(status, "Complete")
WHERE !contains(status, "meta")
SORT priority asc, date asc
FLATTEN truncate(tags, 20)

Im looking for a way to reveal all these columns without having to change any css styles of the theme if possible which Is why I want to use the truncate feature. Any ideas? Screenshot is attached

You do the truncate(tags, 20) but you don’t display the result, so you’re quite close, but not all the way there. Try something like this:

```dataview
table categories AS Category, 
  truncate(tags, 20) AS Type, 
  truncate(status, 20) AS Status, 
  date AS "Date Created"
from "Inbox"
WHERE !contains(status, "Complete")
WHERE !contains(status, "meta")
SORT priority asc, date asc
```

If you would like to also truncate the file name, it’s a little trickier I think, but one way (untested) could be to do something like:

```dataview
TABLE WITHOUT ID link(file.link, truncate(file.name, 20)) as File, categories as Category, ... and the rest of the query ...
```
Bonus tip: How to present code properly in a forum post

If you want to showcase either markdown, or code blocks, or dataview queries properly in a forum post, be sure to add one line before and one life after what you want to present with four backticks, ````. This will ensure that any other backticks (like for code blocks or queries) is properly shown.

1 Like

Thank you very much! Works perfectly.

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