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

Bài Viết → Đếm

AI-generated

Overview

This node manages custom metafields on various Sapo resources, specifically supporting operations such as creating, retrieving, updating, deleting, counting, bulk deleting, and validating metafields. For the resource "Bài Viết" (Articles), it allows users to count the number of metafields associated with a specific article ID, optionally filtered by additional criteria.

Common scenarios include:

  • Counting how many custom metafields are attached to a particular article.
  • Filtering metafields by namespace, key, or creation date range before counting.
  • Integrating with workflows that need to verify the presence or quantity of metadata on articles for content management or reporting purposes.

Example use case:

  • A user wants to know how many metafields exist for an article with ID 123, filtering only those in the "inventory" namespace created after January 1, 2023.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the article resource to target.
Thông Tin Bổ Sung Additional optional filters to refine the count operation:
- 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: A number representing how many metafields matched the specified filters for the given article resource ID.

Example output JSON:

{
  "count": 42
}

No binary data is produced by this operation.

Dependencies

  • Requires an API authentication credential configured in n8n to connect to the Sapo platform.
  • Depends on the internal Sapo API base class to perform metafield operations.
  • The node expects the resource to be one of the predefined types supported by the Sapo API, here specifically "articles" for the selected resource.

Troubleshooting

  • Common issues:

    • Invalid or missing article ID (resourceId) will cause errors or empty results.
    • Incorrect API credentials or network issues may result in authentication or connection errors.
    • Using invalid filter values (e.g., malformed dates) in additional fields can cause request failures.
  • Error messages:

    • Errors from the API will be surfaced with their message; if "Continue On Fail" is disabled, the node execution stops on error.
    • Common error: "Resource not found" if the article ID does not exist.
    • Common error: "Invalid filter parameter" if additionalFields contain unsupported or incorrectly formatted values.
  • Resolution tips:

    • Verify the article ID exists in the Sapo system.
    • Check API credentials and connectivity.
    • Ensure date filters are in correct ISO 8601 format.
    • Enable "Continue On Fail" to handle errors gracefully in workflows.

Links and References

Discussion