Button to update metadata list with textfield contents #225
-
I'm trying to create a button which adds the contents of a textfield to a list property called I can't seem to figure out how to reference another property in the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Have you tried using a JS view field? There are some examples that are similar to what you are asking (I think) under Advanced Use-Cases in the documentation. They utilize JS View Fields. I was able to dynamically update one bind value based off another bind-value when clicking a button using them. For example, setting the |
Beta Was this translation helpful? Give feedback.
-
I ended up using a JS file with the const metaedit = this.app.plugins.plugins["metaedit"].api;
let filePath = this.app.workspace.getActiveFile();
let skillObject = await metaedit.getPropertyValue("skills", filePath);
let newSkillName = await metaedit.getPropertyValue("newSkill", filePath);
skillObject[newSkillName] = "Neutral";
await metaedit.update("skills", skillObject, filePath);
await metaedit.update("newSkill", "", filePath); |
Beta Was this translation helpful? Give feedback.
Or you can use the JS button action to run a JS script where you first get the metadata you want and then update the other metadata based on that. (You can run button actions from JS using the plugins API)