Skip to content

CLI: Cannot set Text (default) type property values via --blocks-file or --update-properties #883

@ThreeIce

Description

@ThreeIce

What Happened?

When using logseq upsert block --blocks-file to batch-create blocks, assigning a string value to a default (Text) type user property produces:

Tempids used only as value in transaction: ("answer text")

Similarly, --update-properties in update mode fails:

logseq upsert block --id 19158 --update-properties '{:user.property/CorrectAnswer-hYSmn9A0 "hello"}'
→ "default property expects a string value or keyword"

The error message says it expects a string value, but a string value is exactly what was provided.

Per the DB version docs, Text type property values are stored as block entities ("text blocks"). The CLI does not auto-create the corresponding property value block — it treats the string as a tempid in batch create, and rejects it outright in update mode.

Reproduce the Bug

  1. Create a tag with a Text (default) type property (e.g. Quiz tag with Correct Answer property)
  2. Attempt batch create with property value:
echo '[{:block/title "test" :block/tags [:user.class/Quiz-KDK56p9G] :user.property/CorrectAnswer-hYSmn9A0 "answer"}]' > blocks.edn
logseq upsert block --graph my-graph --target-page "May 18th, 2026" --blocks-file blocks.edn

→ Error: Tempids used only as value in transaction

  1. Attempt update mode:
logseq upsert block --graph my-graph --id <block-id> --update-properties '{:user.property/CorrectAnswer-hYSmn9A0 "hello"}'

→ Error: default property expects a string value or keyword

  1. Also tested: empty string (""), nil (silently ignored), nested map {:block/title "answer"} (invalid data), numeric block id (same error).

Expected Behavior

The CLI should accept string values for Text (default) type properties and auto-create the property value block internally, consistent with how the Logseq UI handles these properties.

Browser, Desktop or Mobile Platform Information

  • OS: Windows 11
  • CLI version: Build time 2026-05-15, Revision 302f798-dirty (bundled with Logseq desktop app)

Additional Context

  • Property confirmed as type=default, cardinality=one via Datascript query
  • The Logseq source (logseq.db.sqlite.build) uses {:block/title "text" :build/property-value :block} format for Text property values, but CLI's --blocks-file does not support Build EDN syntax
  • Current workaround: find the auto-generated property value block via show --id <block-id>, then update it with upsert block --id <value-block-id> --content "text" — but this only works after the user has interacted with the property in the UI first

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcli

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions