mProjectsCode / obsidian-meta-bind-plugin

A plugin for Obsidian to make your notes interactive with inline input fields, metadata displays, and buttons.
https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/
GNU General Public License v3.0
473 stars 38 forks source link

allow referencing other properties in the update metadata button action #358

Closed mProjectsCode closed 3 months ago

mProjectsCode commented 3 months ago

currently only possible by utilizing JavaScript, either via a button action that can run JS (and then use the MB API) or crating the button dynamically similar to the advanced examples in the docs

mProjectsCode commented 3 months ago

implemented with a getMetadata(bindTarget) function that you can pass a bind target sting.

Example:

label: "Add count to count2"
hidden: false
style: default
actions:
  - type: updateMetadata
    bindTarget: count2
    evaluate: true
    value: "x + getMetadata('count')"