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?
m4sk4r4
September 12, 2022, 2:05pm
3
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:
mnvwvnm
September 12, 2022, 4:46pm
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.
system
Closed
December 11, 2022, 8:34pm
8
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.