SiYuan Block Tool icon

SiYuan Block Tool

Use this tool to create, read, update, move, and delete content blocks within SiYuan documents. Use "append" to add content to a document, "getContentMd" to read a block, or "update" to modify existing content.

Get Child Blocks

AI-generated

Overview

The SiYuan Block Tool node interacts with SiYuan documents to manage content blocks. Specifically, the 'Get Child Blocks' operation retrieves a list of direct child blocks under a specified parent block. This is useful for scenarios where you need to explore or manipulate the structure of a document by accessing its nested blocks, such as building a table of contents or processing document sections.

Use Case Examples

  1. Retrieve all child blocks of a given block ID to display or analyze document structure.
  2. Use the child blocks data to update or move specific blocks within a document.

Properties

Name Meaning
Block ID The unique ID of the block whose child blocks are to be retrieved.

Output

JSON

  • id - The unique identifier of each child block.
  • content - The content or data of each child block.
  • type - The type or category of each child block.

Dependencies

  • Requires an API key credential for SiYuan API authentication.

Troubleshooting

  • Ensure the provided Block ID exists and is accessible; otherwise, the operation may fail or return empty results.
  • Check API credentials and connectivity to the SiYuan server to avoid authentication or network errors.
  • If the block has no children, the output will be an empty list, which is expected behavior.

Links

Discussion