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

Đếm

AI-generated

Overview

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

Common scenarios include:

  • Adding extra metadata to products or orders for enhanced categorization or processing.
  • Counting metafields that match specific filters to analyze data usage.
  • Bulk deleting metafields based on criteria like namespace or key.
  • Validating metafield values before applying them to ensure data integrity.

For example, a user might add a "warehouse_location" metafield to a product to track inventory storage or count how many metafields exist under a certain namespace for reporting purposes.

Properties

Name Meaning
ID Tài Nguyên Numeric ID of the resource (e.g., product, order) to which the metafield belongs.
Thông Tin Bổ Sung Additional optional filters or parameters used in operations like counting, bulk deleting, or listing metafields. Includes:
- Namespace: Filter by metafield namespace.
- Key: Filter by metafield key.
- Tạo Sau (Created After): Filter metafields created after this date/time.
- Tạo Trước (Created Before): Filter metafields created before this date/time.
(Other properties not relevant for Đếm operation are omitted here.)

Note: The "Đếm" (Count) operation specifically uses "ID Tài Nguyên" and "Thông Tin Bổ Sung" properties.

Output

The output JSON contains a single field:

{
  "count": number
}
  • count: The total number of metafields matching the specified resource and additional filter criteria.

No binary data is output by this node.

Dependencies

  • Requires an API authentication credential for the Sapo platform.
  • Uses an internal API client (SapoApiBase) to interact with Sapo's metafield endpoints.
  • No other external services or environment variables are required beyond the configured API credential.

Troubleshooting

  • Common issues:

    • Providing an invalid or missing resource ID will cause API errors.
    • Using incorrect filter formats in "Thông Tin Bổ Sung" may result in no results or errors.
    • Network or authentication failures can prevent successful API calls.
  • Error messages:

    • Errors from the API are caught and either thrown or returned as error objects if "Continue On Fail" is enabled.
    • Typical error messages relate to invalid IDs, unauthorized access, or malformed requests.
  • Resolution tips:

    • Verify the resource ID is correct and exists in Sapo.
    • Ensure the API credential is valid and has necessary permissions.
    • Use proper date-time formats for filtering fields.
    • Enable "Continue On Fail" to handle errors gracefully during batch operations.

Links and References

Discussion