Actions71
- Asset Actions
- Attribute Actions
- Block Actions
- Database Actions
- Document Actions
- Markdown Table Actions
- Notebook Actions
- Search Actions
- System Actions
- Tag Actions
Database → Add Row
AI-generatedOverview
This node operation adds a new row to a SiYuan database (AttributeView block). It is useful for workflows that need to programmatically insert data into a SiYuan database, such as logging new entries, updating records, or automating data collection. For example, you can add a row with specific column values by specifying the AttributeView ID and optionally the database block ID, along with the primary key content and other column values.
Use Case Examples
- Adding a new row to a SiYuan database by specifying the AV ID and setting column values by name and value pairs.
- Inserting a row with a predefined primary key content and fields specified as a JSON object mapping column names to values.
Properties
| Name | Meaning |
|---|---|
| AV ID | The AttributeView ID (the data-av-ID attribute of the database block) used to identify the target database to add a row to. |
| Database Block ID | Optional ID of the database block hosting the AttributeView. If left blank, it is auto-resolved from the AV ID to optimize performance. |
| Primary Key Content | Initial content for the primary key cell of the new row. |
| Fields Mode | Determines how columns are identified and values are set when adding the row. Options include by column name and value pairs, by JSON object mapping column names to values, or by internal column key IDs. |
| Fields | The actual column values to set on the new row, provided either as name-value pairs, JSON object, or key ID-value pairs depending on the selected Fields Mode. |
Output
JSON
success- Indicates whether the row addition operation was successful.rowId- The ID of the newly added row, if available.details- Additional details or metadata about the added row.
Dependencies
- Requires SiYuan API URL and API token credentials for authentication.
Troubleshooting
- Ensure the AV ID is correct and corresponds to an existing AttributeView block; otherwise, the operation will fail to locate the database.
- If specifying the Database Block ID, ensure it matches the hosting block of the AV ID to avoid inconsistencies.
- When using JSON mode for fields, ensure the JSON is well-formed and properly quoted, especially for string values.
- Common errors include missing or invalid API credentials, unsupported resource or operation errors, and malformed input data. Verify all inputs and credentials are correct.