Error in a tFileInputJSON component?

One Star

Error in a tFileInputJSON component?

Hi,
When to copy the data from tFileInputJSON to a tFileOutputExcel and there is no some item in the json file, the data from a column move up.
I access as follows: "$.elements.name" and "$.elements.description"
>JSON data:
{"source": "books", "elements": , }
>OutpuExcel:
name description
book1 desc1
book2 desc2
book3 desc4
book4
>Expected output:
name description
book1 desc1
book2 desc2
book3
book4 desc4
Whats's wrong?
Thanks!
One Star

Re: Error in a tFileInputJSON component?

Hi
Welcome to Talend Community!
I reproduced this issue and got the same result. Besides, I got this.
The Json resource datas maybe have some problems, please make sure the data structure with the same fields.

When I correct the JSON file as follow, I can get expected output.
{"name": "book3", "description": "" }

Regards,
Pedro
One Star

Re: Error in a tFileInputJSON component?

I understand, the source is not correctly formed, unfortunately json source is external to me.
However, it is possible that in the short term the tFileInputJSON component can be manage this error?
Thanks!!
One Star

Re: Error in a tFileInputJSON component?

Hi
The answer is no. You have to get correct JSON file.
Regards,
Pedro
One Star

Re: Error in a tFileInputJSON component?

ok, thanks for the reply.
Regards!
One Star

Re: Error in a tFileInputJSON component?

Hello Guys,
I am facing the same problem where the result of the tFilJSONInput component is not as per expectations.
{
"source": "books",
"elements":
,
}

I am using following JSON Query for
Name = "$.elements.name"
Description = "$.elements.description"

Result
name description
book1 desc1
book2 desc2
book3 desc4
book4
Expectation OR Correct result
name description
book1 desc1
book2 desc2
book3
book4 desc4
Is this a Talend Bug? or Is there any other way to achieve the required output? Please help.