'Add to Database' question

This post was last updated for 200 days ago, and the information may already be changed

So far I'm enjoying SiYuan the most out of available PKM tools. Great job!

Recently, I noticed there is a functionality on a block "Add to database". When I click it, it adds the block to a selected database, but all the columns are empty. I am wondering what are the use cases for this feature? I was wondering if I can add to a database that will automatically fill in data in table with information from the sub-blocks from the added block.

Thank you in advance for the response!

With regards,

Eric

    Solution
    • WanChen

      You may need template columns

      recording.gifimage.png

    Welcome to here!

    Here we can learn from each other how to use SiYuan, give feedback and suggestions, and build SiYuan together.

    Signup About
    Please input reply content ...
    • WanChen

      There should be no space between “.action” and “{ .title}”.

      1 Reply
    • MiscReply
    • WanChen 1

      Please use the following template.

      .action{$id := .id}
      .action{$blockList := queryBlocks "SELECT * FROM blocks where id = (select root_id from blocks where id = '?')" $id}
      .action{$block := first $blockList}
      .action{$block.Content}
      
      1 Reply
    • 88250

      This function can be seen as recording metadata for blocks and managing these metadata (sorting, filtering, etc.) through different views, thereby making it easier to manage blocks.

      1 Reply
    • revachol

      Just wondering: Is there a way to automatically populate some of the metadata depending on which document the block is inserted from? For example, If I insert a block from a document called "Programming" into a database I would like to display the document's title "Programming" in one of the database's columns without having to type it in myself

      1 Reply
    • Visit all replies