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

Xóa

AI-generated

Overview

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 products, orders, customers, blogs, and more. The node supports operations like creating, retrieving, updating, deleting single or multiple metafields, counting metafields, and validating metafield values.

Common scenarios include:

  • Adding custom data fields to products or orders for enhanced tracking.
  • Retrieving specific metafield details for reporting or integration.
  • Bulk deleting metafields to clean up unused metadata.
  • Validating metafield values before applying them to ensure data integrity.

For example, you might use this node to add a "warehouse_location" metafield to a product to track inventory storage locations or delete obsolete metafields from customer records.

Properties

Name Meaning
Thao Tác (operation) Operation to perform: bulkDelete, count, create, delete, get, getMany, update, validate
Tài Nguyên (resource) Resource type to manage metafields on: articles, blogs, collections, customers, orders, pages, products, variants
ID Tài Nguyên (resourceId) Numeric ID of the resource instance to operate on
ID Trường Tùy Chỉnh (metafieldId) Numeric ID of the metafield (required for get, update, delete operations)
Trả Về Tất Cả (returnAll) Boolean flag to return all results when listing metafields (only for getMany operation)
Giới Hạn (limit) Maximum number of results to return when not returning all (only for getMany operation)
Thông Tin Bổ Sung (additionalFields) Additional filters or parameters such as namespace, key, created_at_min, created_at_max (used in getMany, bulkDelete, count)
Dữ Liệu Trường Tùy Chỉnh (data) JSON object defining metafield data for create or update operations, e.g., namespace, key, value, value_type, description
Tùy Chọn Xác Thực (validationData) JSON object with type and value to validate metafield data (used in validate operation)

Output

The node outputs an array with one element containing a json property representing the result of the operation:

  • For create, get, update: returns the metafield object with its properties.
  • For getMany: returns a list/array of metafield objects.
  • For delete: returns { success: true } indicating successful deletion.
  • For bulkDelete: returns the result of the bulk delete operation.
  • For count: returns an object with a count property indicating the number of metafields matching criteria.
  • For validate: returns { valid: true } if validation passes.
  • On error (if continueOnFail is enabled), returns { error: "error message" }.

No binary data output is produced by this node.

Dependencies

  • Requires an API credential for authenticating with the Sapo platform.
  • Uses an internal helper class to interact with Sapo's metafield API endpoints.
  • No external environment variables beyond the API credential are required.

Troubleshooting

  • Common issues:

    • Providing incorrect or missing resource IDs or metafield IDs will cause errors.
    • Invalid JSON structure in the data or validationData properties may lead to failures.
    • Attempting unsupported operations on certain resource types could fail.
    • Network or authentication errors if the API credential is invalid or expired.
  • Error messages:

    • Errors thrown by the API are caught and either stop execution or are returned as error objects if "Continue On Fail" is enabled.
    • Typical messages include "Resource not found", "Invalid metafield ID", or "Validation failed".
  • Resolutions:

    • Verify all required IDs and JSON inputs are correct and well-formed.
    • Ensure the API credential is properly configured and has necessary permissions.
    • Use the "getMany" operation with filters to confirm existing metafields before update or delete.
    • Enable "Continue On Fail" during testing to capture errors without stopping workflow execution.

Links and References

Discussion