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 → Lấy Danh Sách
AI-generatedOverview
This node manages custom metafields on Sapo resources, specifically allowing operations such as creating, retrieving, updating, deleting, counting, and validating metafields. For the "Sản Phẩm" (Products) resource with the "Lấy Danh Sách" (Get Many) operation, it fetches a list of metafields associated with a specific product ID. This is useful for scenarios where you want to retrieve all or a subset of custom fields attached to products, for example, to display additional product metadata, filter products by custom attributes, or synchronize metafield data with other systems.
Practical examples:
- Fetching all custom metafields for a product to display extended product details in an e-commerce dashboard.
- Retrieving metafields filtered by namespace or key to analyze specific categories of metadata.
- Limiting the number of metafields returned for performance optimization when only a few entries are needed.
Properties
| Name | Meaning |
|---|---|
| ID Tài Nguyên | The numeric ID of the product resource whose metafields are being queried. |
| Trả Về Tất Cả | Boolean flag indicating whether to return all metafields or limit the number of results. |
| Giới Hạn | Maximum number of metafields to return if not returning all (minimum 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 date/time. |
| - Tạo Trước | Filter metafields created before this date/time. |
Output
The output is an array containing one object with a json property holding the metafield data retrieved from Sapo.
- For the "Lấy Danh Sách" operation, the
jsonfield contains a list of metafields matching the query parameters. Each metafield typically includes properties like namespace, key, value, value type, description, creation date, and other metadata. - No binary data output is produced by this node.
Example output snippet (conceptual):
{
"json": [
{
"id": 123,
"namespace": "inventory",
"key": "warehouse_location",
"value": "A-12",
"value_type": "string",
"description": "Storage location in warehouse",
"created_at": "2023-01-01T12:00:00Z"
},
...
]
}
Dependencies
- Requires an active connection to the Sapo API via an API key credential configured in n8n.
- The node depends on the internal
SapoApiBaseclass to handle API requests related to metafields. - No additional external services beyond Sapo's API are required.
Troubleshooting
Common issues:
- Invalid or missing product ID (
resourceId) will cause the API call to fail. - Incorrect API credentials or expired tokens will result in authentication errors.
- Using filters (namespace, key, date ranges) that do not match any metafields will return empty results.
- Requesting too many records without enabling "Trả Về Tất Cả" may lead to incomplete data retrieval.
- Invalid or missing product ID (
Error messages:
- Errors from the Sapo API are caught and either thrown or returned as error objects depending on the node’s "Continue On Fail" setting.
- Typical error messages include authentication failures, invalid parameters, or network issues.
Resolution tips:
- Verify the product ID exists and is correct.
- Ensure API credentials are valid and have sufficient permissions.
- Adjust filters to broaden the search if no results are returned.
- Use the "Trả Về Tất Cả" option carefully to avoid performance issues.
Links and References
- Sapo API Documentation (general reference for Sapo API endpoints)
- n8n documentation on creating custom nodes
- n8n community forums for troubleshooting and examples