Inline Field with a SPACE and dataviewJS issue

Hi,

I have an inline field called

Next Up:: this is what I do next

let page = dv.page(dv.current().yesterday);
if (page.next-up)
     { dv.paragraph( "\n**Continue here:** " + page.next-up ) }

Tells me that Reference Error: up is not defined. (-up is yellow in the editor too)

Accessing an inline field

Summary:: this is a summary

with

let page = dv.current();
if (page.summary)
     { dv.paragraph( "\n**Summary:** " + page.summary ) }

works…

So how does the right syntax for using inline fields with spaces in dataviewJS looks like?

  1. What’s dv.current().yesterday? A path?

  2. Use page["Next Up"]

1 Like

There is a mistake in your code.

When I read your code, I understand Yesterday like a inline field or yaml variable.

You can access variable with a space as @mnvwvnm told and if you have doubt how your variables looks like try to do this.

console.log(page) and look the result in dev tools.

  • Sorry for my english mistakes.

yesterday is
Yesterday:: [[2022-09-11]]

page[“Next Up”] works

1 Like

thanks… dataview really needs a copy button to copy error messages etc.
I’m using =this to display the page information.

as you can see the inline fields are there:

2022-09-12 18-21-58 - Workbench - Privat - Obsidian v0.15.6

I think “next-up” works for DQL, not for JS.

yeah it looks like it, which makes it a little arkward because that means that inline field without a space can be accessed directly and with space require an extra / different approach.

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