Open utterances-bot opened 2 months ago
thanks! @YU000jp very useful information!
There is a bug when updating as page properties. Use
updateBlock()
and enterproperty:: value/n
directly at the beginning of its content. The\n
means a new line.) This will load the value into the database as a page property.
That means I need to create a new block, then update the block, and write the block's content in the form of properties. This way, I can set the page properties, right? I'll try it tonight.
@b-yp The problem is when you update properties using upsertBlockProperty it will work as expected, but it will not write to the db, you will need to reindex your graph to make it work.
@b-yp The problem is when you update properties using upsertBlockProperty it will work as expected, but it will not write to the db, you will need to reindex your graph to make it work.
Yes, I am currently stuck at this point. I have many methods to set properties for a page, but these methods do not write to the database; they only look good on the page. When I use the menu (Make it public publishing) to set the public property, it still creates a new block to save the properties, rather than adding them to the original one. Logseq does not have a dedicated API for setting page properties.
https://plugins-doc.logseq.com/logseq/Editor/upsertBlockProperty