Im struggling to work out how to leverage java script to dynamically select different notes.
What I’m trying to do
I am trying to create an encounter calculator that takes the selection of a monster defined in its own file, and populates some local properties that can be used.
The structure of each monster file is the same and is its own folder monsters/[monster-name].md . The simplified metadata is:
Selecting the monster is easy INPUT[suggester(optionQuery("monsters"), useLinks(false)):selectedMonster]
The following works if explicilty referenced as storagePath#property
meta-bind-js-view
{orc#hp} as text
---
return context.bound.text
however the following where selectedMonster = orc fails
meta-bind-js-view
{selectedMonster#hp} as text
---
return context.bound.text
and even if selectedMonster = orc#hp it just returns “orc#hp”
meta-bind-js-view
{selectedMonster#hp} as text
---
return context.bound.text
Any advice would be appreciated on how to structure the js, i know there are potential other solutions using other plugins, but i’d like to at least learn what I’m doing wrong here before moving on.
Coming back to this to add another solution in case someone else needs help with this in the future. Below is an example for dynamically creating a VIEW or INPUT element:
Where can I learn how to do this in Obsidian? I think I’m looking for something similar, however, it will be used for Satisfactory instead where I will have different materials used to create different items. Not sure I will be up to the task but I want to give it a go. How do I make these arrays such as you had orc with different properties?