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

Sản Phẩm → Xác Thực

AI-generated

Overview

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

The "Xác Thực" (Validate) operation specifically verifies whether a given value for a metafield is valid according to predefined rules or constraints in Sapo. This is useful when you want to ensure that data entered into a metafield meets expected criteria before saving or processing it further.

Practical examples:

  • Validating a product's custom attribute value before updating the product record.
  • Checking if a metafield value conforms to required formats or types during data import.
  • Ensuring customer metadata values are correct before triggering workflows based on them.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the resource (e.g., product) to which the metafield belongs.
Tùy Chọn Xác Thực JSON object specifying the validation data, including the type and value to validate.

Example of Tùy Chọn Xác Thực property value:

{
  "type": "string",
  "value": "test value"
}

Output

The node outputs a JSON object with the following structure for the Xác Thực operation:

  • valid: A boolean indicating whether the provided value passed validation (true means valid).

Example output:

{
  "valid": true
}

If an error occurs during validation or other operations, the output will contain an error field with the error message, provided the node is configured to continue on failure.

Dependencies

  • Requires an API credential for authenticating with the Sapo platform.
  • Depends on the internal SapoApiBase class to interact with Sapo's metafield API endpoints.
  • No additional external services beyond Sapo's API are needed.

Troubleshooting

  • Common issues:

    • Invalid or missing resource ID can cause failures.
    • Incorrectly formatted validation data JSON may lead to errors.
    • Network or authentication problems with the Sapo API can prevent successful requests.
  • Error messages:

    • Errors returned from the Sapo API will be surfaced with their message.
    • If validation fails due to invalid input format, the node throws an error describing the issue.
  • Resolutions:

    • Ensure the resource ID corresponds to an existing resource in Sapo.
    • Validate the JSON structure of the validation data before running the node.
    • Verify API credentials and network connectivity.

Links and References

Discussion