Access value pairs only under specific heading

What I’m trying to do

I’m trying to make a 13th age Combat log template for an RPG group of mine. I have a simple form made up in dataview but copying and pasting the form causes issues with the same key names being used. I was wondering if there was a way to have the this.keyName able to take the heading its under as a sort of instance variable.

Form in Question:
##Entity
total :: 80
currentHp :: = number(this.total - sum(this.damage))
damage :: 10,20,-3
= choice((sum(this.damage) >= (this.total/2)),"Staggered","Healthy")

basically just want to be able to copy and paste this code either with a JavaScript for loop or just copy paste and have each instance stand separate.

Things I have tried

Spent a couple of hours looking things up that might help but couldn’t find anything in particular that helped with this issue. This is my first time using JavaScript and still getting the hang of it. I know this probably isn’t what dataview is for but was the sleekest plugin I could find for this.

Dataview is not able to associate inline fields with other than the page itself, as part of a list or task. If however the inline fields are part of a list or task item, it can then be connected to a given section.

Do however note that, when doing stuff like your currentHp that dataview will store the query itself, not the result. This has been discussed some in the recent posts, as well.

In other words, either you need to limit your note to just one entity per note, or you need to shift syntax into some variant of lists or tasks to group the information together, and in either case it’s either the value or the query, and not the query result which is stored in the inline fields.

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