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

Khách Hàng → Lấy Danh Sách

AI-generated

Overview

This node manages custom metafields on various resources within the Sapo platform, specifically here focusing on the "Khách Hàng" (Customer) resource with the "Lấy Danh Sách" (Get Many) operation. It retrieves a list of metafields associated with a specific customer resource ID. This is useful for scenarios where you want to fetch additional metadata or custom fields attached to customers, such as tags, preferences, or other custom attributes that are not part of the standard customer data.

Practical examples include:

  • Retrieving all custom metafields for a given customer to display or process in workflows.
  • Filtering metafields by namespace or key to get specific types of metadata.
  • Limiting the number of results returned or fetching all available metafields depending on workflow needs.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the customer resource whose metafields you want to retrieve.
Trả Về Tất Cả Boolean option to return all metafields or limit the number of results.
Giới Hạn Maximum number of metafield results to return when not returning all.
Thông Tin Bổ Sung Additional optional filters:
- Namespace: Filter metafields by their namespace string.
- Key: Filter metafields by their key.
- 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 JSON objects representing metafields matching the query parameters. Each object corresponds to a metafield and includes its details as returned by the Sapo API. The exact structure depends on the metafield schema but typically includes fields like namespace, key, value, value type, description, creation date, etc.

No binary data is output by this node.

Example output snippet (conceptual):

[
  {
    "namespace": "inventory",
    "key": "warehouse_location",
    "value": "A-12",
    "value_type": "string",
    "description": "Storage location in warehouse"
  },
  ...
]

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 to manage metafields.
  • No additional external dependencies beyond the configured API credentials.

Troubleshooting

  • Common issues:

    • Invalid or missing resource ID will cause the API call to fail.
    • Incorrect or expired API credentials will result in authentication errors.
    • Using filters (namespace, key, date ranges) incorrectly may return empty results.
    • Requesting too many results without enabling "return all" might truncate data unexpectedly.
  • Error messages:

    • Errors from the Sapo API will be surfaced with their message; typical errors include "Resource not found," "Unauthorized," or "Invalid parameters."
    • If the node is set to continue on failure, errors will appear in the output JSON under an error field.
  • Resolutions:

    • Verify the resource ID is correct and exists.
    • Check and refresh API credentials if authentication fails.
    • Adjust filter parameters to valid values.
    • Use "Trả Về Tất Cả" (returnAll) carefully to avoid performance issues with large datasets.

Links and References

Discussion