docs/docs/en/data-sources/collection-comment/index.md
Comment collections are suitable for storing discussions, feedback, and annotations around business records. For example, you can use a Comment collection for task comments, approval opinions, article comments, and customer feedback.
A Comment collection is usually not used as an independent main business collection. A more common approach is to create a Comment collection, configure a relation field in the business collection, and then add a Comment block to the details page or popup for business records.
Comment collections are suitable for these business scenarios:
Comment collections are typically used together with a business collection and a Comment block:
Task comments collection to the Tasks collection.In the main data source, click Create collection and select Comment collection to create a Comment collection.
| Setting | Description |
|---|---|
| Collection display name | The name displayed for the collection, such as Task comments, Approval opinions, or Article comments. |
| Collection name | The collection identifier used internally by APIs, relation fields, permissions, and workflows. |
| Inherits | Select a parent collection to inherit. This setting is visible only when the main database is PostgreSQL. |
| Categories | Collection categories affect only organization in Data source management; they do not change the collection structure. |
| Description | A description of the collection. State which business object it serves, who maintains it, and how comment permissions are designed. |
| Preset fields | Preset fields. Keep system fields and Comment collection built-in fields when creating a Comment collection. |
After a Comment collection is created, it usually includes the following built-in fields. Comment blocks mainly use content, createdBy, and createdAt to display comment text, commenter, and comment time.
| Field | Field name | Description |
|---|---|---|
| ID | id | The default primary key that uniquely identifies a comment record. |
| Comment content | content | Stores the comment text entered by users. It uses the Markdown Vditor interface by default. |
| Created at | createdAt | Automatically records when the comment was created. Comment blocks use it to display the comment time. |
| Created by | createdBy | Automatically records the user who posted the comment. Comment blocks use it to display the commenter. |
| Updated at | updatedAt | Automatically records when the comment was last updated. |
| Updated by | updatedBy | Automatically records the user who last updated the comment. |
| Space | space | Available after enabling the Multi-space plugin. It isolates data by space and does not appear when Multi-space is not enabled. |
:::warning Note
Comment collection built-in fields are normally maintained by Comment blocks and should not be deleted or repurposed casually. To store information such as comment category or processing status, add business fields instead.
:::
Like a general collection, a Comment collection needs a primary key. Comment blocks use the primary key to locate comment records and reply relationships.
If a Comment collection has no primary key, set Record unique key when editing the collection. Otherwise, Comment blocks might not view, reply to, or delete comments correctly.
Create a relation field in the business collection and relate it to the Comment collection.
Comment collections are usually used through Comment blocks. Add a Comment block to a details page, popup, or record page of a business collection to let users comment on the current record.
| Configuration location | Use |
|---|---|
| Details block | Shows a comment entry in business-record details. |
| Form block | Uses the comment relation field in business-collection editing flows. |
| Comment block | Displays the comment list and lets users post and reply to comments. |
In the collection list, click Edit next to a Comment collection to change its display name, category, description, simple pagination mode, Record unique key, and other settings.
After a Comment collection is in use, do not casually change its comment-content field or reply-relation field. Comment blocks, permissions, workflows, and APIs might depend on these fields.
In the collection list, click Delete next to a Comment collection to delete it.
Deleting a Comment collection deletes comment records, reply relations, and related collection metadata. Before deleting it, confirm whether relation fields in business collections, Comment blocks, permissions, workflows, or APIs still depend on it.
:::danger Warning
Deleting a Comment collection removes comment data from existing business records. Comments often contain collaboration history and processing opinions. Confirm whether the data needs to be backed up or archived before proceeding.
:::