square brackets not appearing in json array with one record

One Star

square brackets not appearing in json array with one record

Hi, I am using tWriteJsonField and have an array that has only one record. The output from talend does not put square brackets around the array, please see below example:
Required output:
{"employees":}

Talend output:
{"employees":
    {"firstName":"John""lastName":"Doe"}}

Would request help on this.
Seventeen Stars

Re: square brackets not appearing in json array with one record

The problem here is Talend does not handle JSON internally.They do everything with XML.
Take a look in the documentation. There is a way to get an array by adding an @array attribute in the mapping configuration.
The other solution could be you use components which are dedicated to JSON without the workaround XML.
https://exchange.talend.com/#marketplaceproductoverview:gallery=marketplace%252F1&pi=marketplace%252...

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog