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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Aukema
Creator
Creator

[resolved] Missing values when using tWriteJsonField

Hi,

I want to create the following JSON file:
{
"level1": {
"level2": [{
"level3": {
"newColumn2": "level3value"
},
"newColumn1": "level2value"
}],
"newColumn": "level1value"
}
}
(note the array I use for level2)

I am using tWriteJsonField to achieve this. 


Job overview:

0683p000009MG6f.png





I am using a simple sample configuration to simplify some things.


0683p000009MG6k.png





Finally I created three levels in my output JSON string and added a class attribute in order to achieve the array on the second level


0683p000009MFsK.png





But when running this job, some information is lost and I cannot find a solution to prevent this. The final result looks like this:
{
"level1": {
"level2": [{
"newColumn2": "level3value"
}, "level2value"],
"newColumn": "level1value"
}
}


The array is there, but the Level3 header is lost.

Is there any solution for this?

Labels (2)
1 Solution

Accepted Solutions
Aukema
Creator
Creator
Author

I figured out that you don't only need a array class, but also a element set as loop value. For the example I the OP it should look like this:

0683p000009MG6p.png

View solution in original post

1 Reply
Aukema
Creator
Creator
Author

I figured out that you don't only need a array class, but also a element set as loop value. For the example I the OP it should look like this:

0683p000009MG6p.png