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 → Xác Thực

AI-generated

Overview

This node manages custom metafields on various Sapo resources, including customers. Specifically, for the Khách Hàng (Customer) resource with the Xác Thực (Validate) operation, it validates a given value against the metafield rules defined in Sapo.

Common scenarios where this node is useful include:

  • Ensuring that data entered or imported into customer metafields meets specific validation criteria before saving.
  • Automating data quality checks in workflows involving customer metadata.
  • Pre-validating values to avoid errors downstream when updating or creating metafields.

For example, you might use this node to validate that a customer's custom field value is a string matching certain constraints before updating their record.

Properties

Name Meaning
ID Tài Nguyên The numeric ID of the customer resource to which the metafield belongs.
Tùy Chọn Xác Thực JSON object specifying the validation data. It includes:
- type: The type of the value to validate (e.g., "string").
- value: The actual value to be validated (e.g., "test value").

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

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

Output

The output JSON contains a single field:

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

Example output:

{
  "valid": true
}

No binary data is produced by this operation.

Dependencies

  • Requires an active connection to the Sapo API via an API key credential configured in n8n.
  • The node depends on the internal SapoApiBase class to interact with Sapo's metafield endpoints.
  • Proper permissions on the Sapo account to perform metafield validations on customer resources.

Troubleshooting

  • Validation fails unexpectedly: Ensure the validationData JSON correctly specifies the type and value fields as expected by Sapo's API.
  • API authentication errors: Verify that the API key credential is correctly set up and has sufficient permissions.
  • Resource ID issues: Confirm that the ID Tài Nguyên corresponds to an existing customer in Sapo.
  • Error messages: If the node throws an error with a message from the API, check the stack trace for details and verify input parameters.

If the node is set to continue on fail, errors will be returned in the output JSON under an error field.

Links and References

Discussion