Sapo Trường Tùy Chỉnh icon

Sapo Trường Tùy Chỉnh

Quản lý trường tùy chỉnh trên Sapo

Trang → Đếm

AI-generated

Overview

This node manages custom metafields on various resources within the Sapo platform, specifically supporting operations such as counting, creating, updating, deleting, and validating metafields. For the "Trang" (Page) resource with the "Đếm" (Count) operation, it counts the number of metafields associated with a specific page resource ID, optionally filtered by additional criteria.

Common scenarios include:

  • Counting how many custom fields are attached to a particular page.
  • Filtering metafields by namespace, key, or creation date range before counting.
  • Useful for analytics, reporting, or conditional logic based on the presence or quantity of metafields.

Example use case:

  • A user wants to know how many custom metadata entries exist for a given page to decide if further processing or cleanup is needed.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the page resource whose metafields are being counted.
Thông Tin Bổ Sung Additional optional filters to refine which metafields to count:
- Namespace: Filter metafields by their namespace string.
- Key: Filter metafields by their key string.
- Tạo Sau (Created After): Only count metafields created after this date/time.
- Tạo Trước (Created Before): Only count metafields created before this date/time.

Output

The output JSON contains a single field:

{
  "count": <number>
}
  • count: The total number of metafields matching the specified resource ID and any additional filters.

No binary data is produced by this operation.

Dependencies

  • Requires an active connection to the Sapo API via an API authentication credential configured in n8n.
  • The node uses an internal Sapo API base class to perform metafield operations.
  • No other external dependencies are required.

Troubleshooting

  • Common issues:

    • Invalid or missing resource ID will cause the API call to fail.
    • Incorrect filter formats (e.g., invalid date strings) may result in errors or zero counts.
    • Network or authentication failures with the Sapo API will throw errors.
  • Error messages:

    • Errors from the Sapo API are surfaced with their message; ensure the API credentials are valid and have sufficient permissions.
    • If the node is set to continue on failure, errors will be returned in the output JSON under an error field.
  • Resolution tips:

    • Verify that the resource ID corresponds to an existing page.
    • Check date/time filter formats.
    • Confirm API credentials and network connectivity.

Links and References

Discussion