'Add to Database' question

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,


    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 ...
    • alvorithm
      VIP Warrior

      Hi, @revachol, your question and @WanChen's answer helpe me come up with a solution to a slightly related problem: Advice on how to improve a database template

      Thank you!

    • MiscReply
    • WanChen

      You may need template columns


      1 Reply
    • 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}
      1 Reply
    • revachol

      Thanks. I have already tried using template columns but not sure it's possible to pull in the document's title with them. Templates such as .action {.title} don't seem to work for me. Perhaps, I haven't figured out the correct syntax?

      1 Reply
    • Visit all replies