I have been trying to insert certain comments made in different notes in my folder based on keywords into a table. It kept showing no results. I figured dataview is not able to see the text in notes. When inserting this code: ```dataview TABLE file.name, text FROM “SSP”
```
It displays names of all notes, but in text column it just shows a dash. Also testing for text length shows 0, when obviously there is some. I made sure to allow all necessary permissions for dataview, checked all notes are saved as .md, tried inserting new unformated notes from notepad, even reinstalled both dataview and obsidian. Still cannot reach the text.
Any ideas what I might have missed out?
I don’t know. But instead of making your code italic (which can’t easily be copy/pasted, and changes your quotes to smart quotes), you can surround it with 4 backticks to show the 3 backticks:
````
```dataview
TABLE file.name, text
FROM "SSP"
```
````
Dataview has never been able to read the text with exception of text from list and task items, so I’m wondering where you got the notion it was capable of doing that. ChatGPT?
You can use dataviewjs and javascript functions to read the content of files, but it’s a no-go in a DQL query like yours.
You’re right:D
So would you suggest any other way I would be able to get the content of a note into a table? Since I am trying to create a table putting together comments from different notes based on the first word in the line of the comment. Thank you!
There are four ways to tackle this issue, and they all depend on your level of coding and how you write your notes.
If you’re using bullet lists (and/or tasks with custom statuses) you can use that and do queries towards the single items
If the comments are spread out in between other text, you might consider using inline fields for the various categories of comments you make. I’ve seen people use question, important, and similar, which allows people to have a dedicated page listing the various comments
You can use javascript and actually read the text, but you would still need some kind of logic to extract just the bits and pieces you want, and in many case one of the first options are better choices
The non-query variant is to embed the information from one given file at a time, that is you can use stuff like [[myNote#summary]] which would embed the summary section from myNote. This can also be done using blockId’s
One query to list all tasks with the status of imporant, [!], could be:
```dataview
TASK WHERE status = "!"
```
Another variant of this first option, is if you want to get all the list items tagged with #question:
```dataview
LIST item.text
FROM #question
FLATTEN file.lists as item
WHERE contains(item.tags, "#question")
```
If you’ve used question as an inline field, like in [question:: Why is this working better than the other option?] you could do a query like the following to list all the questions:
```dataview
TABLE aQuestion
WHERE question
FLATTEN question as aQuestion
```
The flatten line is used to separate the questions into separate rows, if there were more than one question in that particular file. If you don’t need the file name/link, you could start the query with TABLE WITHOUT ID.
The latter option of using javascript (or dataviewjs) I’m not going to give an example of as plenty exist in the forums, and we would need a lot more specific information as to what you want to get out of the files.