Property numbers "type mismatch expected Number" with filter in base

Before opening a new bug report, please search the forum for duplicates and follow the Troubleshooting Guide.

  • Developer issues with the API should go here
  • Themes and Custom CSS issues should go here
  • Translations issues/improvements should be posted here
  • Obsidian Clipper Bugs should be posted here
  • Obsidian Importer Bugs should be posted here
  • For Linux, we only accept bug reports that are reproducible with our AppImage or Snap package under Gnome or KDE.

Once you’ve done the above, delete everything above this line.

Steps to reproduce

I made a base with the filter if tag is move and property cost (number) is not empty. If I add a new note from there and fill the cost field with a number I still get the exclamation point with the hover message “type mismatch expected Number”. The number is on the left side and does not count in the summ.
If I click the exclamation it will work.

Did you follow the troubleshooting guide? [Y/N]

Please, follow the Troubleshooting Guide before answering Yes.

Expected result

It should see it as a number if I type in a number, with no extra step.

Actual result

The number was not recognized as a number and I got the “type mismatch expected Number” message

Environment


Additional information

Simplified reproduction steps and debug info.

Steps to reproduce

  1. In the sandbox, create a new note, and paste this:

    ---
    cost: 8
    ---
    
    ```base
    views:
      - type: table
        name: Table
        filters:
          and:
            - "!cost.isEmpty()"
        order:
          - file.name
          - cost
    
    ```
    
    
  2. Click the base’s + New button.

    Note in the popup for the new note that the property type for cost is text.

  3. Type in a number character.

    Note that this enters a text value:


    (Viewing the note in source mode confirms that it has text-type syntax.)

  4. Display the Show all properties panel, and explicitly set cost to a number type.

  5. Repeat steps 2 and 3.

    Note that this still enters a text value:

Did you follow the troubleshooting guide?

Yes

Expected result

The value is recorded as a number.

Actual result

The value is recorded as text.

Environment

SYSTEM INFO:
	Obsidian version: 1.12.4
	Installer version: 1.12.4
	Operating system: Windows 11 Pro for Workstations 10.0.26200
	Login status: logged in
	Language: en
	Catalyst license: insider
	Insider build toggle: on
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 0
	Plugins enabled: 0

RECOMMENDATIONS:
	none

Workaround

In the new-note popup, click the orange caution triangle to update to number format.

Or, after entering a value and saving it (by clicking elsewhere in the popup), delete the value and save it (again by clicking elsewhere in the popup). Obsidian instantly updates the property type even in the popup.

1 Like