How to insert key-value of property in text of my note

What I’m trying to do

I have defined properties in my note (template), I would like in the text of the note to be able to enter name and value of the note
_ _
City: New york
Oter…
_ _

In my text i’d like City: $city other text

Where City is highlighted and instead $city show New York

Things I have tried

I believe it can be done with Dataview but I have not found documentation about it, especially, how to refer to the note itself, without explicitly writing the name of the note

If you’re using the dataview plugin, you could display that value using `= this.City `.

1 Like

Thank you very much.
What syntax should I use to show field names that contain spaces? Such as ‘Previous city’. I know I could change the field name to ‘Previous-City’ but I would like to avoid showing the dash in view mode.

Is there a possibility to show in a property a value composed of text joined with the page title or another property? Or to insert the file title anywhere in the text? Or to insert in the title of the file this.City?

Try the following and see if either of those answer your extended questions:

My city: `= this.City`
or: `= this.city`

Last city: `= this["Previous city"] `
or : `= this.previous-city`

File title: `= this.file.name `

Composite: `= this.file.name + " – " + this.city `

The documentation on Field names could also be well worth a visit, to understand what’s happening. (Or doing `$= dv.span(dv.current())` in a note where you wonder what is defined or not)

1 Like

Thank you again

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