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

Bài Viết → Lấy Danh Sách

AI-generated

Overview

This node manages custom metafields on various resource types within the Sapo platform. It allows users to create, retrieve, update, delete, count, validate, and bulk delete metafields associated with resources such as articles, blogs, collections, customers, orders, pages, products, and product variants.

For the specific operation "Lấy Danh Sách" (Get Many) on the resource "Bài Viết" (Articles), the node fetches a list of metafields attached to a particular article identified by its resource ID. Users can choose to retrieve all metafields or limit the number returned, and apply additional filters like namespace, key, or creation date ranges.

Practical examples:

  • Fetching all custom metafields for an article to display or process metadata such as SEO tags or custom attributes.
  • Retrieving a limited set of metafields filtered by namespace or key to integrate with other systems or workflows.
  • Using date filters to get metafields created within a specific timeframe for auditing or reporting purposes.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the article resource whose metafields are being queried.
Trả Về Tất Cả Boolean option to return all metafields or only up to a specified limit.
Giới Hạn Maximum number of metafields to return when not returning all. Minimum value is 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 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 (e.g., string)
    • description: Description of the metafield
    • created_at, updated_at: Timestamps for creation and last update

No binary data is output by this node.

Dependencies

  • Requires an active connection to the Sapo API via an API authentication credential configured in n8n.
  • Uses the internal SapoApiBase class to interact with metafield endpoints.
  • No additional external dependencies beyond the Sapo API and n8n environment.

Troubleshooting

  • Common issues:

    • Invalid or missing resource ID will cause the API call to fail.
    • Incorrect API credentials or expired tokens will result in authentication errors.
    • Using filters that do not match any metafields will return empty results.
    • Requesting too many records without enabling "return all" may truncate results.
  • Error messages:

    • Errors from the Sapo API are caught and reported with their message.
    • If the node is set to continue on failure, errors appear in the output JSON under an error field.
    • Common error resolution steps include verifying resource IDs, checking API credentials, and adjusting filter parameters.

Links and References

Discussion