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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
RamyaPatnala
Contributor
Contributor

Generate the conditional Node using twriteJsonField and tmap

 

how to implement condition to generate the Json conditional node when ID_NUMBER is not null or empty using Tmap and TwriteJsonfield

 

Labels (1)
  • JSON

1 Reply
gouravdubey5
Partner - Creator
Partner - Creator

Hello,

tWriteJSONField does not support conditional node creation directly. Conditional logic must be applied before JSON generation.

In tMap, set the output field to null when ID_NUMBER is null or empty:

row1.ID_NUMBER != null && !row1.ID_NUMBER.trim().isEmpty()
? row1.ID_NUMBER
: null


Map this field in tWriteJSONField and enable Remove null fields.
When the value is null, the corresponding JSON node is not created.

Thanks,

Gourav

Talend Solution Architect | Data Integration