Wednesday, February 18, 2015

Parse JSON in Talend

Sample source (JSON)

{
   "next_offset": -1,
   "records": [
      {
         "my_favorite": false,
         "following": true,
         "id": "766f5e38-7bae-5881-0d7c-5425054c7efe",
         "name": "moto",
         "date_entered": "2014-09-26T11:48:51+05:30",
         "date_modified": "2014-09-26T11:48:51+05:30",
         "modified_user_id": "caea1f89-7517-58bb-c5ed-53fdad8ab84c",
         "modified_by_name": "Brij",
         "created_by": "caea1f89-7517-58bb-c5ed-53fdad8ab84c",
         "created_by_name": "Brij",
         "doc_owner": "",
         "user_favorites": "",
         "description": "hello moto crm 7 test by Brij",
         "deleted": false,
         "assigned_user_id": "caea1f89-7517-58bb-c5ed-53fdad8ab84c",
         "assigned_user_name": "Brij",
         "team_count": "",
         "team_name": [
            {
               "id": "1",
               "name": "Global",
               "name_2": "",
               "primary": true
            }
         ],
         "email": [
            {
               "email_address": "brijbhushansh@gmail.com",
               "primary_address": true,
               "reply_to_address": false,
               "invalid_email": false,
               "opt_out": false
            }
         ],
         "email1": "brijbhushansh@gmail.com",
         "email2": "",
         "invalid_email": false,
         "email_opt_out": false,
         "email_addresses_non_primary": "",
         "facebook": "",
         "twitter": "",
         "googleplus": "",
         "account_type": "Analyst",
         "industry": "Engineering",
         "annual_revenue": "222",
         "phone_fax": "23332232",
         "billing_address_street": "A42/6",
         "billing_address_street_2": "",
         "billing_address_street_3": "",
         "billing_address_street_4": "",
         "billing_address_city": "noida",
         "billing_address_state": "up",
         "billing_address_postalcode": "201301",
         "billing_address_country": "India",
         "rating": "8",
         "phone_office": "011-1022094",
         "phone_alternate": "9989999",
         "website": "motorola.com",
         "ownership": "ownshp",
         "employees": "oss",
         "ticker_symbol": "2112",
         "shipping_address_street": "A42/6",
         "shipping_address_street_2": "",
         "shipping_address_street_3": "",
         "shipping_address_street_4": "",
         "shipping_address_city": "noida",
         "shipping_address_state": "up",
         "shipping_address_postalcode": "201301",
         "shipping_address_country": "India",
         "parent_id": "7e51715b-85be-49ce-aa48-53e9adcb8277",
         "sic_code": "1211212",
         "duns_num": "",
         "parent_name": "BNP Paribas",
         "campaign_id": "",
         "campaign_name": "",
         "_acl": {
            "fields": {}
         },
         "_module": "Accounts"
      },
      {
         "my_favorite": false,
         "following": true,
         "id": "72c43463-4b61-8c05-fe21-542176653bbd",
         "name": "bbs a/c",
         "date_entered": "2014-09-23T19:03:45+05:30",
         "date_modified": "2014-09-23T19:03:45+05:30",
         "modified_user_id": "caea1f89-7517-58bb-c5ed-53fdad8ab84c",
         "modified_by_name": "Brij",
         "created_by": "caea1f89-7517-58bb-c5ed-53fdad8ab84c",
         "created_by_name": "Brij",
         "doc_owner": "",
         "user_favorites": "",
         "description": "",
         "deleted": false,
         "assigned_user_id": "caea1f89-7517-58bb-c5ed-53fdad8ab84c",
         "assigned_user_name": "Brij",
         "team_count": "",
         "team_name": [
            {
               "id": "1",
               "name": "Global",
               "name_2": "",
               "primary": true
            }
         ],
         "email": [],
         "email1": "",
         "email2": "",
         "invalid_email": "",
         "email_opt_out": "",
         "email_addresses_non_primary": "",
         "facebook": "",
         "twitter": "",
         "googleplus": "",
         "account_type": "",
         "industry": "",
         "annual_revenue": "",
         "phone_fax": "",
         "billing_address_street": "",
         "billing_address_street_2": "",
         "billing_address_street_3": "",
         "billing_address_street_4": "",
         "billing_address_city": "",
         "billing_address_state": "",
         "billing_address_postalcode": "",
         "billing_address_country": "",
         "rating": "",
         "phone_office": "",
         "phone_alternate": "",
         "website": "",
         "ownership": "",
         "employees": "",
         "ticker_symbol": "",
         "shipping_address_street": "",
         "shipping_address_street_2": "",
         "shipping_address_street_3": "",
         "shipping_address_street_4": "",
         "shipping_address_city": "",
         "shipping_address_state": "",
         "shipping_address_postalcode": "",
         "shipping_address_country": "",
         "parent_id": "",
         "sic_code": "",
         "duns_num": "",
         "parent_name": "",
         "campaign_id": "",
         "campaign_name": "",
         "_acl": {
            "fields": {}
         },
         "_module": "Accounts"
      }
   ]
}


Solution:

We will use tExtractJSONFields for fetching data-



No comments:

Post a Comment