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 → Lấy Danh Sách
AI-generatedOverview
This node manages custom metafields on various Sapo resources, specifically supporting operations like creating, retrieving, updating, deleting, counting, and validating metafields. The "Lấy Danh Sách" (Get Many) operation fetches a list of metafields associated with a specified resource variant by its ID.
Common scenarios include:
- Retrieving all or a limited number of custom metafields attached to a product variant to display or process additional metadata.
- Filtering metafields by namespace, key, or creation date range to narrow down relevant data.
- Integrating with inventory or product management workflows where custom fields hold important supplementary information.
Practical example:
- Fetching all metafields for a specific product variant to synchronize custom inventory locations or attributes with an external system.
Properties
| Name | Meaning |
|---|---|
| ID Tài Nguyên | The numeric ID of the resource variant whose metafields are being queried. |
| Trả Về Tất Cả | Boolean flag indicating whether to return all metafields or limit the number of results returned. |
| Giới Hạn | Maximum number of metafield results to return when not returning all. Minimum value is 1. |
| Thông Tin Bổ Sung | Additional optional filters to refine the metafield query: |
| - Namespace: Filter metafields by their namespace string. | |
| - Key: Filter metafields by their key string. | |
| - Tạo Sau: Filter metafields created after this datetime. | |
| - Tạo Trước: Filter metafields created before this datetime. |
Output
The output JSON contains an array of metafield objects matching the query criteria. Each metafield object typically includes details such as its namespace, key, value, value type, description, and associated resource identifiers.
No binary data output is produced by this operation.
Example output snippet (conceptual):
[
{
"namespace": "inventory",
"key": "warehouse_location",
"value": "A-12",
"value_type": "string",
"description": "Storage location in warehouse",
"owner_type": "variant",
"owner_id": 12345
},
...
]
Dependencies
- Requires an API authentication credential configured in n8n to connect to the Sapo platform.
- Depends on the internal
SapoApiBaseclass to perform REST API calls to manage metafields. - The node expects the resource to be one of the predefined types (e.g., variants for product variants).
Troubleshooting
Common issues:
- Providing an invalid or missing resource ID will cause the API call to fail.
- Incorrect or expired API credentials will result in authentication errors.
- Using incompatible filter values (e.g., invalid date formats) may cause request failures.
Error messages:
- Errors from the API are caught and either thrown or returned as error objects depending on the node's "Continue On Fail" setting.
- Typical error messages include authorization failures, resource not found, or validation errors on input parameters.
Resolution tips:
- Verify that the resource ID corresponds to an existing variant.
- Ensure API credentials are valid and have sufficient permissions.
- Use correct data types and formats for filters and limits.
Links and References
- Sapo API Documentation (general reference for metafield endpoints)
- n8n documentation on creating custom nodes
- JSON Schema and DateTime formatting guides for proper input formatting