Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tWriteJSONField and element with empty string

I would like to create json object using tWriteJSONField:

{
"title":""
}



but instead I got

{
"title":[]
}


Tried to use empty string from tMap component as input, spent some time trying to enter a hardcoded empty string but no success :-|.

Is it a good practice to use this component for json output? Maybe there is a better way to create a json file with mapping using other components?

Labels (2)
5 Replies
Anonymous
Not applicable
Author

Hi,
Could you please elaborate your case with an example with input and expected output values? In this way, we can design a demo job for you.
Best regards
Sabrina
Pooja_kataria
Contributor III
Contributor III

Hi,

Did you got the solution for this question?

I amfacing same issue .Can you please help me with it?

Pooja_kataria
Contributor III
Contributor III

Hi,

Did you got the solution for this question?

I amfacing same issue .Can you please help me with it?

root
Creator II
Creator II

https://help.talend.com/reader/LNO9Tqm8svZQklRyXL8OYw/HDXOdWVienee_BuL7LstpQ

Pls check the note:

Note: For any field with the null value, this component writes a pair of square brackets ([]). If needed, you can remove or replace them using a regular expression in a tJavaRow component next to the tWriteJSONField component. For exmaple:
output_row.rootNode = input_row.rootNode.replaceAll("\\[\\]", "");
root
Creator II
Creator II

https://help.talend.com/reader/LNO9Tqm8svZQklRyXL8OYw/HDXOdWVienee_BuL7LstpQ

Pls check the note:

Note: For any field with the null value, this component writes a pair of square brackets ([]). If needed, you can remove or replace them using a regular expression in a tJavaRow component next to the tWriteJSONField component. For exmaple:
output_row.rootNode = input_row.rootNode.replaceAll("\\[\\]", "");