All Products
Search
Document Center

Dataphin:Configure script mode widget

Last Updated:Mar 05, 2025

The script mode widget allows for the configuration of items not supported by system widgets, accommodating specific business scenarios.

Procedure

  1. On the Dataphin home page, navigate to the top menu bar and select Development > Data Integration.

  2. Select Project on the top menu bar of the integration page. For Dev-Prod mode, select Environment.

  3. In the left-side navigation pane, click Batch Pipeline. Then, in the Batch Pipeline list, click the Offline Pipeline you want to develop to access its configuration page.

  4. Click Component Library in the upper right corner of the page to open the Component Library panel.

  5. In the Component Library panel's left-side navigation pane, select Outputs. Then, in the output widget list on the right, locate the Script Mode widget and drag it onto the canvas.

  6. Click and drag the image icon of the desired input, transform, or flow widget to connect it to the script mode output widget.

  7. Click the image icon on the script mode output widget card to open the Script Mode Output Configuration dialog box. image

  8. In the Script Mode Output Configuration dialog box, set the parameters.

    Parameter

    Description

    Step Name

    This is the name of the script mode output widget. Dataphin automatically generates the step name, and you can also modify it according to business scenarios. The naming convention is as follows:

    • Can only contain Chinese characters, letters, underscores (_), and numbers.

    • Cannot exceed 64 characters.

    Data Source Type

    Select the data source type.

    Datasource

    Select the file encoding method. The system supports UTF-8 and GBK methods.

    Configuration File

    Edit the script:

    1. Click Generate Sync Configuration File. The Configuration File area on the right side of the page displays the output widget template.

    2. In the Configuration File area, write the configuration file code. An example is as follows.

      {
          "table": "tableName",
          "columnMapping": [
              {
                  "sourceColName": "",
                  "dstColName": ""
              }
          ],
          "parameter": {
            
          }
      }

      Where:

      • table: The single input table and multiple input tables of the output widget. The key value for multiple input tables is tables, and the key value for a single input table is table. If the widget does not involve a table, this parameter is not available.

      • columnMapping: Configuration of input-output field mapping relationships, regardless of order.

      • parameter: For widget parameters, see the description of the corresponding widget.

  9. Click Confirm to finalize the property settings for the Script Mode Output Widget.