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
Khách Hàng → Đếm
AI-generatedOverview
This node manages custom metafields on various Sapo resources, including customers. Specifically, the "Đếm" (Count) operation for the "Khách Hàng" (Customer) resource counts the number of metafields associated with a given customer resource ID, optionally filtered by additional criteria.
Common scenarios where this node is useful include:
- Quickly determining how many custom metafields exist for a specific customer.
- Filtering metafields by namespace, key, or creation date range to count only relevant entries.
- Integrating with workflows that need to validate or audit metadata completeness on customer records.
For example, you might use this node to count all metafields under the "preferences" namespace for a particular customer to check if certain custom data has been set.
Properties
| Name | Meaning |
|---|---|
| ID Tài Nguyên | The numeric ID of the customer 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 filters for the given customer resource ID.
No binary data is output by this operation.
Dependencies
- Requires an API authentication credential to connect to the Sapo platform.
- The node depends on the internal Sapo API base class to perform metafield operations.
- No additional external services beyond the Sapo API are required.
Troubleshooting
Common issues:
- Providing an invalid or non-existent customer resource ID will likely result in an error or zero count.
- Incorrectly formatted date/time filters may cause the API call to fail.
- Missing or invalid API credentials will prevent successful connection to the Sapo API.
Error messages:
- Errors from the Sapo API will be surfaced as node errors with descriptive messages.
- If the node is configured to continue on failure, errors will appear in the output JSON under an
errorfield.
Resolutions:
- Verify the customer ID exists and is correct.
- Ensure date/time filters follow the expected format.
- Confirm API credentials are valid and have sufficient permissions.
Links and References
- Sapo API Documentation (general reference for Sapo platform APIs)
- n8n documentation on Custom Nodes for further customization guidance