Using tRest and tExtractJSONField to map the JSON file in Talend

+1 vote

I am struggling with tRest component while trying to retrieve the JSON data. I am sharing the screenshot of the Job I have created. image

Following is the screenshot of my tExtractJSONField component which I am using in order to extract the “text” field from the input data: image

But the with this is, I am not able to add all the attributes for mapping.

Please suggest me how to get this done.

Following is the sample of the input file I am using:

{
"posts": 
 [
    {
        "network": "twitter",
        "post_id": "547835328170823680",
        "text": "#tunisie .. #tunis",
        "html": " ",
        "permalink": " ",
        "post_time": 1419449095,
        "user_id": "159415522",
        "user_name": " ",
        "user_real_name": " ",
        "user_profile_image_url": " ",
        "hashtags": [ "tunisie", "tunis" ]        
    },
    {
        "network": "Facebook",
        "post_id": "547835328170823680",
        "text": "#tunisia .. #tunis",
        "html": " ",
        "permalink": " ",
        "post_time": 1777449095,
        "user_id": "159995522",
        "user_name": " ",
        "user_real_name": " ",
        "user_profile_image_url": " ",
        "hashtags": [ "tunisia", "tunis2" ]        
    }
]
}
Apr 18, 2018 in Talend by code.reaper12
• 3,500 points
4,966 views

1 answer to this question.

0 votes

In this case, I believe you can use tMap component. It's a powerful processing component which comes in handy in multiple scenarios. In order to configure the schema of the incoming and outgoing data follow the below example:

image

Hope this will help!

Join the Talend course today to know more about and become expert.

Thanks.

answered Apr 18, 2018 by geek.erkami
• 2,680 points

Related Questions In Talend

0 votes
1 answer
0 votes
1 answer

Using tHiveRow to execute multiple Hive queries in Talend

In order to execute multiple queries, you ...READ MORE

answered Apr 14, 2018 in Talend by misc.edu04
• 1,450 points
3,842 views
0 votes
1 answer
0 votes
1 answer

How to loading flat file from configuration in Talend?

Hey, @There, Regarding your query you need to ...READ MORE

answered Jun 4, 2020 in Talend by Gitika
• 65,770 points
2,204 views
0 votes
1 answer

tWaitForFile component insufficiency in Talend

Regarding your first issue, tWaitForFile component provides ...READ MORE

answered Apr 11, 2018 in Talend by geek.erkami
• 2,680 points
2,513 views
+1 vote
1 answer
0 votes
2 answers

Closed loop in Talend

Hi, Talend specifies that tUnite cannot be ...READ MORE

answered Aug 23, 2019 in Talend by vinceall
2,341 views
0 votes
1 answer
0 votes
1 answer

Using Java Classes in Talend

While working with routines, the very 1st ...READ MORE

answered Apr 14, 2018 in Talend by geek.erkami
• 2,680 points
2,734 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP