Things I have tried
I have looked on the forums and found some links explaining some dataview js: post 1 and post 2. I also tried googling dataview JS and inline JS expressions. However, I do not know how to incorporate the DQL “outgoing links” query into dataview JS inline, and I think this is at the core of the problem.
What I’m trying to do
I basically want to use inline dataview JS to count how many files fulfill two arguments:
- the first argument is that a specific YAML field is equal to a certain value. I was able to get it to work using this code:
$= dv.pages().where(page => page.hub == "101 Reflections").length
- The second argument is that the active page links to it. In normal DQL, I’m able to find this using:
dataview table from outgoing([[101 Reflections]]) where econtains(hub, "101 Reflections")
However, I really want it to be inline, and I have no idea how to incorporate the two arguments together in an inline query.
I assume if I can figure out how to query for outlinks, then I will be able to make it work since all I’d have to do is write: $= dv.pages().where(page => page.hub == "101 Reflections" && OUTLINKQUERYWHATEVERITIS).length