Sapo Trường Tùy Chỉnh icon

Sapo Trường Tùy Chỉnh

Quản lý trường tùy chỉnh trên Sapo

Lấy Danh Sách

AI-generated

Overview

This node manages custom metafields on various resource types within the Sapo platform. Metafields are additional data fields that can be attached to resources such as products, orders, customers, blogs, and more, allowing users to extend the default data model with custom information.

The "Lấy Danh Sách" (Get Many) operation retrieves a list of metafields associated with a specific resource identified by its ID. It supports filtering by namespace, key, creation date range, and allows controlling the number of results returned or fetching all available metafields.

Common scenarios:

  • Fetching all custom metafields for a product to display or process extended attributes.
  • Retrieving metafields filtered by namespace or key to find specific metadata.
  • Exporting metafield data for reporting or synchronization with other systems.

Example:
Retrieve up to 50 metafields for a product with ID 123, filtering only those created after January 1, 2023, in the "inventory" namespace.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the resource (e.g., product, order) whose metafields you want to retrieve.
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 when not returning all (minimum 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 item with a json property holding the retrieved metafields data. The structure depends on the Sapo API response but generally includes:

  • A list of metafield objects, each containing details such as:
    • id: Metafield identifier
    • namespace: The metafield's namespace
    • key: The metafield's key
    • value: The stored value
    • value_type: Type of the value (string, integer, etc.)
    • description: Optional description
    • created_at, updated_at: Timestamps

No binary data is output by this operation.

Dependencies

  • Requires an active connection to the Sapo API via an API credential configured in n8n.
  • The node uses an internal Sapo API base class to interact with metafields endpoints.
  • Proper permissions on the Sapo account to read metafields for the specified resource.

Troubleshooting

  • Common issues:

    • Invalid or missing resource ID will cause the API call to fail.
    • Insufficient permissions or invalid API credentials will result in authentication errors.
    • Using filters with incorrect formats (e.g., invalid date strings) may cause request errors.
  • Error messages:

    • Errors from the Sapo API are caught and returned as error messages in the node output if "Continue On Fail" is enabled.
    • Otherwise, the node execution stops with an error showing the message and stack trace.
  • Resolution tips:

    • Verify the resource ID is correct and exists in the Sapo system.
    • Check API credentials and permissions.
    • Ensure date filters are in valid ISO 8601 format.
    • Use "Return All" carefully to avoid large data loads impacting performance.

Links and References

Discussion