Create a new property when checking a checkbox property, Metadata Menu approach?

What I’m trying to do

Being in a note, I want to add a specific new property to it when I check a checkbox property.

The expected behaviour should be this, explained with my use case:

  • If the checkbox property named “activated” is checked (ie the value is true in the frontmatter) → it will create the new property (named “result”) for the note.

  • If the checkbox property named “activated” is unchecked (ie the value is false in the frontmatter) → it will do nothing (no property creation), or it will delete the property “result” if it’s already created in the note.

Graphically:

1- Checkbox “activated” unchecked:

2- When the checkbox “activated” is checked:

:small_red_triangle: The trigger for the new property creation should be the check in the checkbox :small_red_triangle:

Things I have tried

I’ve been researching quite extensively to find the tools to make it done. I know that a workaround can be done with Linter, but that will require to trigger Linter periodically (manually or automatically) in all the notes, and that’s not the idea for the workflow. The trigger should be the check in the checkbox.

The plugin that I think got me closer to find a solution is Metadata Menu, because it has options to modify frontmatter, and define preset types and values.

But after hours of testing I’m stuck :face_with_diagonal_mouth:. Maybe this is something that can’t be done, and I’m going in circles in a dead end. I would love to know if that’s the case :slightly_smiling_face:

The last thing I tried was to create a Formula type field in Metadata Menu, and to put there a javascript formula that add the property field intended (but it doesn’t happen). I think that’s because this field just return values and doesn’t have the capacity to add a property, but I’m not sure


The formula down there was created with chatGPT, since I don’t know how to code in javascript. So may be it’s not right.


Main questions

  1. Is this something doable somehow? (creating a new property based on the value of another one—a checkbox specifically), can it be done with the Metadata Menu plugin approach?

  2. If this is something doable but can’t be done with my approach, do you know how can be done?.
    I’ve been researching a lot on this forum and several related and although I’ve seen that this was consulted in various ocassions I didn’t saw any concrete solution yet

no experience with metadata menu, unfortunately…

i have no major experience in coding and obsidian inner workings as regards plugins but it could be difficult to have a listener to check the status of a checkbox

it would be easier to make a Templater Js Script and assign an icon or hotkey to it which will change the value of activated property to true in the frontmatter and create the frontmatter property key result and some value below it

but i agree it would be nicer to communicate through the checkbox…

another workaround would be the meta bind plugin and maybe hooking it up with dataview as in the method linked in this post

I appreciate your views on this @Yurcee.

  1. Using the Templater Js Script is a workaround I’ve been already analyzing. But since my intention is to simplify the workflow and that solution require to trigger the js script manually, I kept searching.

  2. I think that another workaround could also be done with Meta bind plugin as you suggested, but as you say it will be nicer and less cumbersome for the workflow to trigger the new property creation directly from the check in the checkbox property.


I think that the only plugin I’ve seen so far that that have the power to potentially create this solution is Metadata Menu. Let’s see if we see another response in that direction, it’s getting interesting :face_with_monocle:

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