Check if property equals link to current note

What I’m trying to do

I have several notes that use properties. Some of the property values are links to other notes.
On my current note, I want to display all notes in a table, that have the link to the current note as a property.

Things I have tried

My current code looks as follows:

dv.table(["Company", "Year", "Website", "Type", "Products/Services"], dv.pages('"organisations"').where(p => p.country == dv.fileLink(dv.current().file.path,true))
.sort(p => p.name)
.map(p => {
	return [p.file.link, p.year_founded, p.website, p.type, p.products_services]
	}
	)
	)

However, this doesn’t lead to any results. I’m going to guess that I’m not checking for the link property in the right way, but I can’t find any reference anywhere on how to get the current page’s link to begin with. Any help would be incredibly appreciated.

Ok sometimes, as you write out your problem you get your eureka moment, the way I solved this just now is by using:

dv.equals(p.country,dv.current().file.link)

to check for the property being equal to the link to the current page.

1 Like

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