I have 2 notes as described as example below. NoteA contains inline fields Project Name & Project Duration. In NoteB, I tried to retrieve the Project Name and Project Duration values from NoteA. However, it does not return any value. I am guessing that I am not using the correct method in getting the inline fields values. As I managed to get values if I move these inline fields into YAML frontmatter. Any advice?
Hi, anyone have idea? There was some typo in earlier post. Updated as below. Basically I am trying to get value with attribute name with a space in between ie. Project Name. I tried attribute name with “-” ie. Project-Name with not value return.
================================================================
I have 2 notes as described as example below. NoteA contains inline fields Project Name & Project Duration. In NoteB, I tried to retrieve the Project Name and Project Duration values from NoteA. However, it does not return any value. I am guessing that I am not using the correct method in getting the inline fields values. As I managed to get values if I move these inline fields into YAML frontmatter. Any advice?
you need to use dv.page() instead of dv.pages(), because you’re defining as source a page and not pages inside a folder or with a specific tag: use dv.page("NoteA")
the second issue is related with the use of the key as expression (this is a key:: value); in simple dataview queries you can use an “-” replacing the spaces (this-is-a-key) but in dataviewjs javascript doesn’t allow that and you need to use another index method:
`$=dv.page("NoteA")["Project Name"]`
in simple dataview queries you can use the “-” method (this-is-a-key ) and a js similar with the prefix “row”: row["this is a key"]