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:
The trigger for the new property creation should be the check in the checkbox
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 . 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
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
-
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?
-
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