Parsing Multi-array JSON and Correlating Fields (For Versions Before V4.1.6.2)

  • Last update: January 16, 2026
  • iconNote:
    This document applies to FineDataLink of versions earlier than V4.1.6.2.

    Overview

    Application Scenario

    The JSON data contains multiple array fields, as shown in the following figure.

    You want to parse these array fields and align them in a one‑to‑one correspondence, as shown in the following figure.

    Implementation Method

    You can select the JSON field to be parsed in a JSON Parsing operator and modify the JSON path.

    Example

    Retrieving JSON Data

    In the actual environment, JSON data originates from various sources. This section creates JSON data containing arrays.

    1. Create a scheduled task, drag a Data Transformation node onto the page, and enter the Data Transformation editing page. 

    2. Drag in a Spark SQL operator and configure it to create JSON data containing arrays, simulating the usage scenario, as shown in the following figure.

    The SQL script is as follows:

    select '{
    "header": {
    "desc": "success",
    "failures": [],
    "oprs": 1,
    "succ": 1,
    "oprtime": 0,
    "quota": 1,
    "rquota": 200000000,
    "status": 0,
    "traceid": "a9874ba8-b3a0-11ed-8323-97b36044f232"
    },
    "body": {
    "data": [
    {
    "result": {
    "total": 20,
    "pageSum": [
    [
    386,
    130,
    279,
    212,
    189,
    41.98,
    263,
    71.06,
    230,
    8.61,
    "--",
    "--"
    ],
    [],
    []
    ],
    "timeSpan": [
    "2023/03/01 - 2023/03/02"
    ],
    "sum": [
    [
    364,
    200,
    249,
    212,
    82,
    41.98,
    253,
    71.06,
    220,
    1.61,
    "--",
    "--"
    ],
    []
    ],
    "fields": [
    "aa",
    "bb",
    "cc",
    "dd",
    "ee",
    "ff",
    "hh",
    "ii",
    "er",
    "ef",
    "qw",
    "dg"
    ]
    }
    }
    ],
    "expand": {}
    }
    }' as json

    Parsing JSON Data

    Drag in a JSON Parsing operator and configure it to parse the JSON data.

    1. Select json as the source field, and choose sum and fields nodes.

    2. Click Data Preview, as shown in the following figure.

    The data after parsing is in an array format. You need to modify the JSON path to correctly parse the array fields so that the generated fields correspond one-to-one.

    2. Modify the JSON path, as shown in the following figure.

    JSON ExpressionDescription
    [0] [*]

    [0] indicates accessing the first element in an array. In a JSON array, the index typically starts from 0, so [0] means accessing the first element of the array.

    [*] is a wildcard character that matches all elements in an array at the current position.

    The expression [0][*] accesses the first element in a JSON array and retrieves all its child elements. This is commonly used in nested JSON structures to obtain a collection of child elements from a specific element.

    For more details about JSON paths, see https://github.com/json-path/JsonPath.

    Click Data Preview, as shown in the following figure.

    3. You can continue processing or output the data as needed.


    附件列表


    主题: Data Development - Scheduled Task
    • 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