Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a single row/record with few fields:
someFlag: boolean
fieldString1: String
fieldString2: String
fieldString3: String
and I need to create a json document formatted like this:
{
"document" : [ {
"settings" : [ {
"someFlag" : true
}, {
"fieldString2" : "someText"
}, {
"fieldString3" : "SomeMoreText"
}],
"fieldString1" : "3068@myemail.mydomain.com"
} ]
}
I am using tJSONDoc (tJSONDocOutput) by JLolling to create the rest of the document, but this section has proven to be too hard.
Ideas or suggestions very welcome.
Hi,
I have a small doubt in your requirement here. The output data for String2 and String3 are in list at different level compared to boolean value and field1. So could you please advise how you are arranging them in input side in column fashion?
Could you please advise the reason for String 2 and String 3 at different level in JSON compared to String 1?
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Hi,
Could you please try to create JSON conversion using the metadata area of JSON?
https://help.talend.com/reader/lqV2ftgSbYSEBU9Bwsd61w/hCTD2DEpip2q~4n1MxWEMg
If you are facing any issues, could you please share the component screen shots so that we will know the exact issue while doing the conversion?
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
try this
Output
{"document": [ {"setting":[
{"flag":"true"},
{"str1":"abc"},
{"str2":"def"}
],
"str3":"xxxxx@gmail.com"
}
]
}