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

Trang → Cập Nhật

AI-generated

Overview

This node manages custom metafields on various resource types within the Sapo platform. Metafields are additional data fields that can be attached to resources like pages, products, orders, customers, and more, allowing users to extend the default data model with custom information.

The "Cập Nhật" (Update) operation for the "Trang" (Page) resource updates an existing custom metafield on a specific page by its ID. This is useful when you want to modify metadata such as inventory locations, descriptions, or any other custom attributes associated with a page.

Practical example:
You have a website page representing a product category, and you want to update a custom field that tracks the warehouse location or promotional tag for that page. Using this node, you specify the page ID, the metafield ID, and the new data to update the metafield accordingly.

Properties

Name Meaning
ID Tài Nguyên The unique numeric identifier of the page resource to update the metafield on.
ID Trường Tùy Chỉnh The unique numeric identifier of the custom metafield to update on the specified page.
Dữ Liệu Trường Tùy Chỉnh JSON object containing the metafield data to update. It includes: namespace, key, value, value_type, and description.

Example of Dữ Liệu Trường Tùy Chỉnh JSON structure:

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

Output

The node outputs a JSON object representing the updated metafield data returned from the Sapo API. This typically includes all properties of the metafield after the update, such as its namespace, key, value, value type, description, and identifiers.

If the update is successful, the output JSON will contain the updated metafield details. If an error occurs and the node is configured to continue on failure, the output will include an error message describing the issue.

Dependencies

  • Requires a valid connection to the Sapo API via an API authentication credential.
  • The node depends on the internal SapoApiBase class to interact with the Sapo metafields endpoints.
  • Proper permissions on the Sapo account to update metafields on the specified resource.

Troubleshooting

  • Common issues:

    • Invalid or missing resource ID or metafield ID will cause the update to fail.
    • Incorrectly formatted JSON in the metafield data property may result in validation errors.
    • Insufficient API permissions or expired credentials can lead to authorization errors.
    • Network connectivity problems can cause request failures.
  • Error messages:

    • "Resource not found": Verify the resource ID and metafield ID exist.
    • "Invalid metafield data": Check the JSON structure and required fields (namespace, key, value, value_type).
    • "Unauthorized" or "Authentication failed": Confirm API credentials are correct and active.
    • For other errors, review the detailed stack trace if available and ensure the node's input parameters are correctly set.

Links and References

Discussion