Skip to content

page set: cannot clear a select / multi_select property with empty value #52

@DidelotK

Description

@DidelotK

Description

notion page set <id> "MySelect=" (empty value) cannot be used to clear a select property. The CLI sends {"select": {"name": ""}} to the Notion API, which is rejected with:

validation_error: body failed validation. Fix one:
  body.properties.<Field>.select.id should be defined, instead was `undefined`.
  body.properties.<Field>.select.name should be populated, instead was "".

To clear a select field in Notion, the body must be {"select": null}.

Repro

# Create a page in a DB with a select property "Status" set to some value
notion page set <page-id> "Status="
# → validation_error: body.properties.Status.select.name should be populated, instead was ""

Workaround

Drop down to the raw API:

notion api PATCH /v1/pages/<page-id> --body '{"properties":{"Status":{"select":null}}}'

Expected

The CLI's page set should map Key= (or Key="") for select / multi_select / status / date / etc. properties to a null value in the API call. This is a common operation (e.g., un-classifying a row).

Environment

  • notion-cli v0.7.0
  • Same behavior observed for multi_select clearing via empty value

Impact

Real bug — clearing a select is a normal operation but currently requires falling back to notion api PATCH with hand-rolled JSON.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions