Skip to content
Actions for Obsidian icon Home Actions for Obsidian 2024.1.3 › Actions

Actions for Obsidian › Actions › Set Note Properties

Overwrites or updates a note’s properties, and saves the note.

Parameters

Vault

The vault to work in.

Type: Vault reference

File Path

The path of the note, relative to the vault root.

Type: Text

Dictionary

Pass in a Shortcuts Dictionary here. The action will only process dictionary keys whose values are valid Obsidian Property types: string, list of strings, number, and boolean. (Date and Date & Time properties are represented as string values.) Everything else, e.g. dictionary values, lists containing anything other than strings, will be ignored. Just like in Obsidian, nested properties are not supported.

Hint: On Mac, you can right-click any parameter field. That’ll bring up the context menu, in which you’ll find the defined variable from previous steps/actions. On iPad, long-tapping does the same thing.

Type: Dictionary

Mode

You can replace everything, meaning all of the note’s properties will be replaced with the new ones. Or you can update the existing properties, meaning those keys from the passed-in properties that are new will be added to the note, those that are existing will be replaced, and any other will be left untouched.

Options:

  • replace everything
  • add new keys, update existing

Return Value

Note reference

How it works

In absence of a dedicated Obsidian API method for writing properties (AFAICT), Actions for Obsidian will translate the passed-in dictionary into front matter YAML, and then replace the old front matter. Obsidian will pick up the file change and populate the note’s properties from the changed front matter. Exactly how Obsidian interprets those values (as text, a list of texts, a number, or a checkbox) is up to you, and it can only be specified in Obsidian itself — please see the official Property doc page for more details.

Example

The the example below, I’ve used a Dictionary action to set up a Shortcuts dictionary data structure:

KeyTypeValue
modifiedAtTextCurrent Date (the built-in variable)
listArraythree Text entries: “one”, “2”, “three”
checkboxBooleanFalse
ohNoDictionary”keyOne”: “one” (a text), “keyTwo”: 2 (a number)

The result of this action is used in the Set Note Properties action for my note “Hello.md” in my vault “Workbench”, as input for the parameter “Dictionary”:

When the workflow is executed, Set Note Properties causes Obsidian to update the note with the three key/value pairs “modifiedAt”, “list”, and “checkbox” because they use valid value types. The key/value pair “ohNo” is ignored because its value is neither a text, nor a list of texts, nor a number, nor a boolean.