Built-in file integration

更新时间:
复制 MD 格式

The Mobi platform provides a powerful file integration feature that lets you manage file resources through simple configurations. This document describes how to use this built-in integration.

Feature introduction

Built-in file integration is a pre-configured integration on the Mobi platform for standardized file processing. You can call it directly without manual configuration. It supports deleting files or copying files to a remote server.

Create a file integration

Create an integration operation in an application

  1. Open the Code panel, click the plus sign (+) for the corresponding scope, and then select Integration Operation.

  2. Select Built-in file integration as the resource. Then, select the desired operation type and trigger method for the integration operation.

  1. Click Run to preview the query results.

Configuration panel details

General configurations

The parameters that you need to configure vary based on the selected operation type. The following operation types are available:

  • Delete file: Deletes a file using a simple configuration. This operation includes the following parameter:

    • Mobi file ID: The ID of the file uploaded to Mobi file resources.

  • Copy file to remote server: Copies a file to a remote server. This operation requires a more detailed configuration and includes the following parameters:

    • Mobi file ID: The ID of the file uploaded to Mobi file resources.

    • Request: The upload method and the URL of the remote server.

    • Header: The header information to include when you upload the file to the remote server.

Callback configuration

  • Data transformation: Processes the data returned by the API. The default value is return data, which means the data is returned without being processed.

  • Success callback: The event to trigger when the API call succeeds.

  • Failure callback: The event to trigger when the API call fails.

Advanced configuration

  • Debounce: A debounce expression to prevent frequent API calls.

  • Execution prevention condition: A conditional expression that determines whether to execute this integration operation.

Manually trigger an integration

Event trigger

  1. In the component where you want to trigger the integration operation, configure an event handler.

  2. Set the action type to Integration Operation and select the corresponding integration.

  3. Enter the required parameters as an object.

API trigger

If an integration operation is named action1, you can trigger it from any script by calling the action1.trigger() method. If the operation requires parameters, provide them as an object.