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
Sản Phẩm → Xóa Hàng Loạt
AI-generatedOverview
This node manages custom metafields on various resources within the Sapo platform, specifically supporting operations such as creating, retrieving, updating, deleting, counting, validating, and bulk deleting metafields. For the "Sản Phẩm" (Products) resource with the "Xóa Hàng Loạt" (Bulk Delete) operation, it allows users to delete multiple metafields associated with a specific product ID based on optional filtering criteria.
Common scenarios include cleaning up or removing multiple custom fields from products in bulk, for example, when certain metadata is no longer relevant or needs to be refreshed. This can save time compared to deleting metafields one by one.
Practical example: A user wants to remove all metafields under a specific namespace or key for a product identified by its ID, effectively clearing out outdated custom data in one operation.
Properties
| Name | Meaning |
|---|---|
| ID Tài Nguyên | The numeric ID of the product resource whose metafields are targeted for bulk deletion. |
| Thông Tin Bổ Sung | Additional optional filters to narrow down which metafields to delete. Options include: |
| - Namespace: Filter metafields by their namespace string. | |
| - Key: Filter metafields by their key string. | |
| - Tạo Sau (Created After): Filter metafields created after this date/time. | |
| - Tạo Trước (Created Before): Filter metafields created before this date/time. |
Output
The output JSON contains the result of the bulk delete operation. Typically, it returns an object indicating success status:
{
"success": true
}
This confirms that the requested metafields matching the criteria were deleted successfully.
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to the Sapo API via an API authentication credential.
- The node depends on the internal
SapoApiBaseclass to interact with the metafields endpoint. - Proper configuration of the API credential in n8n is necessary for authentication and authorization.
Troubleshooting
Common issues:
- Providing an invalid or non-existent product ID will likely cause errors or no metafields to be deleted.
- Incorrect filter values (e.g., invalid date formats) may lead to unexpected results or API errors.
- Lack of proper API permissions can cause authorization failures.
Error messages:
- Errors returned from the API will be surfaced with their message. For example, "Resource not found" if the product ID does not exist.
- If the node is set to continue on fail, errors will appear in the output JSON under an
errorfield.
Resolution tips:
- Verify the product ID exists and is correct.
- Double-check filter parameters for correctness.
- Ensure the API credential has sufficient permissions to delete metafields.
- Enable "Continue On Fail" cautiously to handle partial failures gracefully.
Links and References
- Sapo API Documentation (general reference for API endpoints and metafield management)
- n8n documentation on Creating Custom Nodes