Data Synchronization - Server Dataset

  • Last update: December 13, 2024
  • Overview

    Version

    FineDataLink VersionFunctional Change
    2.2Allowed using the server dataset as the data source to read data from CSV and Excel files.

    Application Scenario

    You want to read data from Excel and CSV files.

    The Data Synchronization node of FineDataLink allows using server datasets as data sources to read data from Excel and CSV files.

    Function Description

    You can create a file dataset under System Management > Data Connection > Server Dataset.

    iconNote:

    1. The uploaded Excel file is stored in the \webapps\webroot\WEB-INF\reportlets\excel path in the FineDataLink installation directory.

    2. You can also use the File Input operator to read file data after configuring the data connection to the local server directory or the FTP/SFTP server.

    You can read data from the file dataset using the Data Synchronization node.

    Example One: File Path Without a Parameter

    This section uses the Excel dataset as an example. You can also create the dataset using TXT and XML files.

    You can download the example data. Contract Fact Table Data.xlsx

    Creating an Excel Dataset

    1. Create a file dataset, as shown in the following figure.

    2. Name the dataset Contract Fact Table Data, set File Source to Excel, and click Local File to upload the Excel file, as shown in the following figure.

    3. Click the Save button in the upper right corner. The Excel dataset is created successfully, as shown in the following figure.

    Configuring the Data Synchronization Node

    1. Create a scheduled task and drag a Data Synchronization node onto the page.

    2. Select the Contract Fact Table Data dataset as the data source, as shown in the following figure.

    Click Data Preview to view the fetched Excel data, as shown in the following figure.

    3. Click the Data Destination and Mapping tab, select the Contract table in the SQLite database as the target table, and keep the default field mapping relationship, which can be viewed or modified in the Field Mapping area, as shown in the following figure.

    4. Set Write Method to Write Data into Target Table Directly to write all the data into the target table, as shown in the following figure.

    Effect Display

    1. Click Run in the upper right corner, as shown in the following figure.

    2. The data in the Contract table after successful execution is shown in the following figure.

    Example Two: File Path with a Parameter

    You can use parameters in File Source to define the file path read by the created file dataset.

    Setting the Parameter

    Set a parameter named today in a scheduled task to pass the current date, as shown in the following figure.

    Creating an Excel Dataset

    Store the Excel file on a server and obtain the file URL.

    iconNote:
    Ensure that the FineDataLink project can access this file successfully, otherwise the call will fail.

    2. Log in to FineDataLink and follow the steps to create a file dataset.

    3. Name the dataset Data, set File Source to URL, and enter the file storage path that contains the today parameter, such as http://192.168.5.175:8081/${today}. xlsx, as shown in the following figure.

    In this case, if the current date is 2022-09-27, the URL is http://192.168.5.175:8081/2022-09-27.xlsx.

    iconNote
    If the URL contains Chinese characters, encode it first for normal access.

    4. Set Parameter Type to Date, enter the default value, and click Preview, as shown in the following figure.

    5. Click Save.

    Configuring the Data Synchronization Node

    The steps are the same as those in Example One.

    Others

    The File Input operator in the Data Transformation node allows you to:

    • Read data from Excel or CSV files of the same format in batches.

    • Customize the types of fields output by Excel and CSV files.

    • Fetch CSV file data from Row N+1.

    • Read data from TXT files.

    • Enter the filename extension in a case-insensitive manner.

    • Read data from JSON and XML files.

    • Read data from CSV-like files when File Type is set to CSV, such as TSV, LOG, and DT (mixed CSV and XML)/DBF files.


    附件列表


    主题: Data Development - Scheduled Task
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy