Extract JSON data diferent levels

Highlighted
Four Stars

Extract JSON data diferent levels

I want to extract JSON data from a file and update a database with the data that i extracted from my file.

 

The code bellow represents my JSON data simplified :

 

 

{
  "data": {
    "uniqueIdData": "1",
    "datecreat": "2019-09-23",
    "libelle": "Septembre 2019",
    "user": "user.user@user.com",
    "date": "2019-09-23 00:00:00",
    "user": [
      {
        "uniqueId": "1",
        "expenseDate": "2019-09-23",
        "categoryName": "Car",
        "categoryType": "Car",
        "approb": [
          {
            "lvl": 1,
            "user": "user1.user@user.com",
            "date": "2019-09-26 00:00:00"
          }
        ],
        "verif_user": "user2.user@usercom",
        "verif_date": "2019-09-26 00:00:00",
        "compta_user": "user3.user@user.com",
        "compta_date": "2019-09-30 00:00:00",
        "code_projet": "PROJECTX"
      },
      {
        "uniqueId": "2",
        "expenseDate": "2019-09-24",
        "categoryName": "Fuel",
        "categoryType": "Fuel",
        "approb": [
          {
            "niv": 1,
            "user": "user2.user@user.com",
            "date": "2019-09-26 00:00:00"
          }
        ],
        "verif_user": "user2.user@user.com",
        "verif_date": "2019-09-26 00:00:00",
        "compta_user": "user3.user@user.com",
        "compta_date": "2019-10-05 00:00:00",
        "code_projet": "PROJECTY"
      }
    ]
  }
}

 

 

As you cans see the are 3 levels data =>  users => aprob.

 

2019-12-05 16_44_55-VMBEL20 - vmbel20 - Connexion Bureau à distance.pngJob struct

 

What i have :

 

2019-12-05 16_48_53-_new 2 - Notepad++.pngResult

What i want to have :

2019-12-05 16_50_32-_new 2 - Notepad++.pngObjectif

Community Manager

Re: Extract JSON data diferent levels

Hi
Read by 'Xpath' model and set the loop xpath as "/data/user/approb", you should be able to extract all records.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Six Stars

Re: Extract JSON data diferent levels

hello vicentef

 

if still interested i have solution.

 

just reply and i post solution.

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

The Forrester Wave: Strategic iPaaS and Hybrid Integration Platforms, Q1 2019

Find out how Forrester rate different iPaaS and Hybrid Integration Platforms

Read

Getting Started with APIs

Find out how to get started with APIs

Read

How to Modernize Your Cloud Platform for Big Data Analytics With Talend and Micr...

Learn how<SPAN>to modernize your Cloud Platform for Big Data Analytics with Talend and Microsoft Azure</SPAN>

Read