When I change a property type, please convert all its values to that type automatically

Use case or problem

I have some numeric properties and suddenly realize I want to convert that property to a string. So I do so, the Obsidian GUI allows that.
However, the actual property values now are all giving errors because they are numbers, not strings, so it’s a mismatch.
This causes mysterious errors, table formatting and sorting issues, etc. All because I changed a property type, a seemingly supported and reasonable thing to do.

Obsidian clearly can do this, as you can click a button to fix a broken value by hand in each file… (see below)

Proposed solution

Automatically coerce all values for a property to the new type.
If the coercion fails for some values in some files, for example changing text → numbers, leading to trying to coerce the value “red” to a number, then mark that value as an error just as you do now using the little yellow triangle.

Current workaround

Go to each file with an error, and click the little yellow error triangle and say “yes convert this, fix this.” But there is no way to find the files with errors, so it’s just “fix when you find them.”


Currently, I have to write a shell script or javascript to look at every file and change the values based on what I know about YAML formatting, a process that is error-prone and requires advanced skills.

Related feature requests

somewhat related to https://forum.obsidian.md/t/recognize-properties-automatically-or-convert-existing-text-into-properties/

1 Like