question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fields as Expressions

See original GitHub issue

What happened?

According documentation, “if the field name has spaces, punctuation, or other non-letter/number characters, then you can refer to it using Dataview’s simplified name, which is all lower case with spaces replaced with “-”.” If so, First field becomes first-field.

However, there is a difference between frontmatter and inline fields.

The rule declared in the documentation works only for inline fields, not for frontmatter fields. For these cases it’s seems necessary using this syntax:

  • row["First field"] in DQL queries
  • this["First field"] in inline DQL
  • (for JS I don’t know)

DQL

Field in frontmatter

TABLE row["First field"]
FROM "folder"

=this["First field"]

Inline field

TABLE first-field
FROM "folder"

=this.first-field

JS

No response

Dataview Version

0.4.21

Obsidian Version

0.12.19

OS

MacOS

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
blacksmithgucommented, Dec 18, 2021

Ah, oversight on my part w.r.t. frontmatter. I forgot you could have spaces in keys and so I didn’t canonicalize them - I’ve fixed this for next release.

0reactions
ooker777commented, Dec 15, 2022

@s-blu I mean, is there a resource to read more on the row object?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Field Expressions
A field expression represents the value of a field. Create a field expression to change the value, datatype, scale, or precision of a...
Read more >
Expression.Field Method (System.Linq.Expressions)
Field(Expression, FieldInfo). Creates a MemberExpression that represents accessing a field.
Read more >
Defining computed fields with expressions
A computed field is a field that is appended to the open table and populated with the value of the specified expression.
Read more >
Understand Formula Field's Expression
Fields are to be referred by their field link names. Expressions can include all types of field except add notes and section. A...
Read more >
Calculate Field expressions—ArcGIS Pro | Documentation
The Calculate Field tool uses Arcade expressions to determine field values. You can perform simple and advanced calculations that are applied to all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found