Usually, we use tWriteJsonField component to write flat data into JSON fields.
The work flow looks like:tfixedflow-->twritejsonfield-->output.
When you get some compile errors, please check your "Code" tab in your job. There will be your compile error highlighted in red line.
What we can do is to make sure that Talend will be your best choice!