Dataview error..help

Hello everyone! My goal was to create a search button for a specific folder via meta-bind (which worked), what’s missing now is telling it which results it should show via dataview (didn’t work)

In case you need the search button (search):

INPUT[text:searchTerm]

The dataview source code in question (#Results)

TABLE without id file.link as "List from Vault",
tags as Tags,
summary as Notes,
Date-Added as "Date Added",
source as "Source URL"
FROM "03 Spaces/System Engineer Wiki/Powershell" OR #Powershell 
WHERE this.searchTerm != null AND
this.searchTerm != "" AND
(contains(lower(file.name), lower(this.searchTerm))
OR contains (lower(file.content), lower (this.searchTerm))
OR contains (lower(file.tags), lower (this.searchTerm)))
SORT file.name ASC

Error message:

Dataview: Error: 
-- PARSING FAILED --------------------------------------------------

   8 | this.searchTerm != "" AND
   9 | (contains(lower(file.name), lower(this.searchTerm))
> 10 | OR contains (lower(file.content), lower (this.searchTerm))
     |             ^
  11 | OR contains (lower(file.tags), lower (this.searchTerm)))
  12 | SORT file.name ASC

Expected one of the following: 

')', '*' or '/' or '%', '+' or '-', '>=' or '<=' or '!=' or '=' or '>' or '<', 'and' or 'or'

I can’t find any syntax errors for the life of me, any help is greatly appreciated!

Also I’m sorry if I missed telling crutial info, this is my first post so feel free to correct me!

Thank you in advance!

Hi @hcina-bit , welcome to the Obsidian community!

Your Dataview query has two issues that I can see:

The first issue is that there should be no space between a function call such as contains and the parentheses that follow it. Your WHERE clauses should look more like this:

OR contains(lower(file.content), lower(this.searchTerm))

The second issue is with file.content – I guess you mean to search the text of the page using this, but there is no built-in file.content field. Dataview cannot see the text content of pages; it can only see properties, tasks, and list items. There isn’t a way to accomplish full page text search using Dataview.

FYI, you can find a list of all built-in page properties here:

I hope this helps.

Craig

Hi @Craig, thank you so much!! Your awnser was a huge help, I finally was able to run it successfully, yay!:smiley:

Also thank you for the list of the properties! I will use it well:)

1 Like