Talend Data Mapper - JSON -> CSV

One Star

Talend Data Mapper - JSON -> CSV

Hi,
Today I have a JSON file that I want to convert to CSV (via tHMap component) but I have a problem with empty values in loop, which creates offsets in my file.
Here the longpagesummary may not exist and in this case, Talend doesn't create Initiator/Terminator (separator ; ) so i have a file which not correct.
In example, i want Initiator/Terminator in line 6 in case where the field doesn't exist.

Thank's for your help !
One Star

Re: Talend Data Mapper - JSON -> CSV

Hi,
Can't you add a filter in your loop to make sure you have fields not empty ?
Eric
One Star

Re: Talend Data Mapper - JSON -> CSV

Hello Eric,
If I add a filter in my loop, there is only 1 element with initiator and terminator. So my final file is not correct.
With a filter I have:
"ID";"LOOP_VALUE";"TEXT"
"1";"ABC"
"2";"Value Exemple";"CDE"
"3";"EFG"
"4";"GHI"

instead of:
"ID";"LOOP_VALUE";"TEXT"
"1";"";"ABC"
"2";"Value Exemple";"CDE"
"3";"";"EFG"
"4";"";"GHI"
One Star

Re: Talend Data Mapper - JSON -> CSV

Could you upload your map ?
One Star

Re: Talend Data Mapper - JSON -> CSV

Yes no probleme, here the zip file of Map:
map_forum.zip.zip
One Star

Re: Talend Data Mapper - JSON -> CSV

Hi,
Here it is what I can suggest:
1-You create a new field description_default (Not looping)

2-His value is blank:
3-And you enter an emit condition:
Eric