Actions72
- Bài Viết Actions
- Blog Actions
- Bộ Sưu Tập Actions
- Khách Hàng Actions
- Đơn Hàng Actions
- Trang Actions
- Sản Phẩm Actions
- Biến Thể Sản Phẩm Actions
Biến Thể Sản Phẩm → Đếm
AI-generatedOverview
This node manages custom metafields on various Sapo resources, specifically including "Biến Thể Sản Phẩm" (Product Variants). It allows users to perform operations such as counting, creating, retrieving, updating, deleting, bulk deleting, listing, and validating metafields associated with a given resource variant.
For the Đếm (Count) operation on the "Biến Thể Sản Phẩm" resource, the node counts how many metafields exist for a specified product variant, optionally filtered by additional criteria like namespace, key, or creation date range.
Common scenarios:
- Quickly determining how many custom metafields are attached to a specific product variant.
- Filtering metafields by namespace or key to count only relevant entries.
- Using counts to monitor or audit metadata usage on product variants.
Practical example:
A user wants to know how many custom metafields are assigned to a particular product variant with ID 12345, filtering only those created after January 1, 2023. This node can return that count efficiently.
Properties
| Name | Meaning |
|---|---|
| ID Tài Nguyên | The numeric ID of the product variant resource to operate on (required). |
| Thông Tin Bổ Sung | Additional optional filters for the count operation: |
| - Namespace: Filter metafields by their namespace string. | |
| - Key: Filter metafields by their key string. | |
| - Tạo Sau: Filter metafields created after this date/time. | |
| - Tạo Trước: Filter 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 filters for the given product variant.
No binary data is output by this operation.
Dependencies
- Requires an API credential for authenticating with the Sapo platform.
- Depends on the internal Sapo API base class to interact with metafield endpoints.
- The node expects proper configuration of the API credentials in n8n to function correctly.
Troubleshooting
Common issues:
- Providing an invalid or non-existent product variant ID will likely result in an error or zero count.
- Incorrect date formats in the filter fields may cause request failures.
- Missing or invalid API credentials will prevent successful API calls.
Error messages:
- Errors from the Sapo API (e.g., authentication errors, resource not found) will be surfaced with their message.
- If the node is set to continue on fail, errors will appear in the output JSON under an
errorfield.
Resolutions:
- Verify the product variant ID exists and is correct.
- Ensure date/time filters use valid ISO 8601 format.
- Confirm API credentials are properly configured and have necessary permissions.
Links and References
- Sapo API Documentation (general reference for metafield management)
- n8n documentation on creating custom nodes