Skip to content

Field with spaces or multi word field #259

Answered by blacksmithgu
asknet asked this question in Q&A
Field with spaces or multi word field #259
May 31, 2021 · 2 answers · 4 replies

Hi,

I have field name that consists of multiple words. When I tried to use this plugin in dataview query, it is throwing parsing error. I couldn't find any usage related to this in documentation.

Wondering if this is supported?

Thank you

Dataview doesn't recognize spaces in field names in queries, to be specific - you have two options:

  • Use dataview's query-friendly name for a field. If your field is called "Film Name", you can use it in a query as film-name. In general, to get the dataview query-friendly name, make it all lower case and replace spaces with dashes ("hello there" -> "hello-there", etc).
  • Use dataview's row syntax, where you can refer to an arbitrary field via row["field name"]. So, for example, row["Film Name"].

Replies

2 suggested answers
·
4 replies

@blacksmithgu can you pls help on this? Thanks!

2 replies
@asknet

thank you for your response.
I'm referring to field name, for example:
Film Name:: Avatar

Last I tested it is not recognizing when field name has spaces.

@filmgal

Ah, sorry about that. I mistook "field names" for "field values".

Dataview doesn't recognize spaces in field names in queries, to be specific - you have two options:

  • Use dataview's query-friendly name for a field. If your field is called "Film Name", you can use it in a query as film-name. In general, to get the dataview query-friendly name, make it all lower case and replace spaces with dashes ("hello there" -> "hello-there", etc).
  • Use dataview's row syntax, where you can refer to an arbitrary field via row["field name"]. So, for example, row["Film Name"].
2 replies
@AlexShevyakov

Good day, sorry to bother with what seems to be an answered topic, however, why do we use syntax like row["field name"] and not column["field name"]? Are we not addressing column name, like in SQL where SELECT colName from tabName?

@AlexShevyakov

Also I have noticed that options mentioined above work differently.
Specifically
in WHERE statement:

LIST 
FROM "" 
WHERE row["note type"] = "book impression"

but in SELECT statement:

TABLE author, title, note-type, file.tags as tags
FROM #book-impression OR #book-review 

I mean I could not use row["field name"] in SELECT statement to make it work.

Answer selected by asknet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants