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
Bộ Sưu Tập → Lấy Danh Sách
AI-generatedOverview
This node manages custom metafields on various resource types within the Sapo platform. Metafields are additional metadata fields that can be attached to resources such as collections, products, customers, orders, and more. The "Lấy Danh Sách" (Get Many) operation retrieves a list of metafields associated with a specific resource instance.
Common scenarios for this node include:
- Fetching all custom metadata fields for a particular collection to display or process them.
- Filtering metafields by namespace or key to find specific metadata entries.
- Limiting the number of results returned for performance or pagination purposes.
- Retrieving metafields created within a certain date range.
Practical example:
- You have a collection identified by its ID and want to retrieve up to 50 metafields related to it, filtering only those in a specific namespace or with a certain key.
Properties
| Name | Meaning |
|---|---|
| ID Tài Nguyên | The numeric ID of the resource instance (e.g., a specific collection) whose metafields to fetch. |
| Trả Về Tất Cả | Boolean flag indicating whether to return all metafields (true) or limit the number of results (false). |
| Giới Hạn | Maximum number of metafields to return when not returning all. Must be at least 1. |
| Thông Tin Bổ Sung | Additional optional filters to refine the metafield list: |
| - 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 retrieved metafields data. The structure depends on the Sapo API response but generally includes:
- A list/array of metafield objects, each representing a custom field attached to the specified resource.
- Each metafield typically contains properties like
namespace,key,value,value_type,description, creation timestamps, and IDs.
No binary data is output by this operation.
Example output snippet (conceptual):
{
"metafields": [
{
"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 authentication credential configured in n8n.
- The node uses the Sapo API base class internally to perform authenticated requests.
- No other external services or environment variables are needed beyond the API credential.
Troubleshooting
Common issues:
- Invalid or missing resource ID will cause the API call to fail.
- Incorrect namespace or key filters may result in empty lists.
- Requesting too many results without proper limits might lead to timeouts or rate limiting.
Error messages:
- API errors from Sapo (e.g., unauthorized, not found) will be surfaced with their message.
- If the node is set to continue on failure, errors will appear in the output JSON under an
errorproperty.
Resolutions:
- Ensure the resource ID corresponds to an existing resource.
- Use valid namespaces and keys as defined in your Sapo store.
- Adjust limits or enable pagination if large datasets are expected.
- Verify API credentials and permissions.
Links and References
- Sapo API Documentation (general reference for metafields and resources)
- n8n documentation on creating custom nodes (for understanding node development concepts)