Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tWriteJSONField quotes numeric fields

Dear folks,

it seems the component tWriteJSONField doesn't respect the data types of incoming columns and just writes all values in Strings.
My expectation is, that numeric values are not enclosed in quotes in the output of the component.

This causes me big trouble in a use-case, where I have to transform an Excel file with several columns to a JSON String, since the numeric values are all quoted and thus the application parsing the file fails...

I'm working with TOS 6.2.1.20160704_1411.

Are there any known workarounds?

Example Job:
JSON_EXAMPLE.zip.zip

Screenshot:
0683p000009MGSJ.png

Labels (2)
2 Replies
cterenzi
Specialist
Specialist

According to the documentation: https://help.talend.com/search/all?query=tWriteJSONField
...the default type of all elements is String.  If you want an element to be numeric, you need to add an attribute named "type" and give it the static value of the type you want.
Anonymous
Not applicable
Author

cterenzi wrote:
According to the documentation: https://help.talend.com/search/all?query=tWriteJSONField
...the default type of all elements is String.  If you want an element to be numeric, you need to add an attribute named "type" and give it the static value of the type you want.

Hi cterenzi,

thanks for your reply, this actually works fine.

However, if you have > 200 columns where you have to define the type like this, this can be a tough job ^^ But I guess there is no other possibility right now *lookingforthetrainee*.