Base:query column names -- display names vs JSON export names

Use case or problem

Obsidian CLI command base:query returns JSON string with property names using the display names of the properties in the used view, which are a matter of change and can’t be reliably referenced over time in external scripts processing the exported JSON data, undermining automation.

For example, a frontmatter property “applicationDate” can have display name “Application date” and is exported in JSON as the latter. But, I would like to preserve the spelling “applicationDate” in the produced JSON.

As a matter of a proposal, for bases queries, shall the queried columns have an export name in addition to display names?

An interesting situation happens when views of the same base are displayed in several notes. When display names are modified by the user for columns of one view, other views showing the same columns are also updated.
Which means that I can forget the existing automation setup, i.e., “Don’t modify the list of columns in the view and don’t change their names, because those are used to produce JSON used by external applications”. If some display names are updated for any view of a particular base, the view which I use to export JSON with Obsidian CLI command will also be changed, and the exported property names will also be changed (unintentionally). There should be a way to prevent this.

Proposed solution

Option 1. Introduce export names in addition to display names for view properties.

Option 2. Make display names view-specific, i.e., when modified, they should change only for the view for which they were modified

Current workaround (optional)

Create an identical view solely for the purposes of data export during automation with display names intended for future use with JSON and other data export formats.

Related feature requests (optional)

Add this object option for subcommand base:query of CLI

1 Like