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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Sudhee_Maximus
Creator
Creator

creating json structure (loop in side loops ) and call an API to insert records.

Hi There,

 

I am using mysql to read some records in below format and trying to create json format as given below ...

 

 

tried using twrite json field like  -->  tmysqlinput --> tmap (for joins) --> twritejsonfield-->tflowtoiterate-->trest (here it inserts records ).

but when i try to loops multiple times (here I have 7 language codes coming as separate elements (columns) and all of them should go as a array of records with other columns ... how can I achieve this JSON fromat )?

SQL as below  :- 

ROW_ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
JOB_ID int,
P_CMO_CODE VARCHAR( 12 ) NOT NULL,
P_CNTY_CD_LOC VARCHAR( 3 )NOT NULL,
P_TY_CD VARCHAR( 1 )NOT NULL,
P_GROUP VARCHAR( 1 )NOT NULL,
P_ID VARCHAR( 12 )NOT NULL,
P_LAST_NAM VARCHAR( 35 )NOT NULL,
P_FST_NAM VARCHAR( 15 ),
P_MI_NAM VARCHAR( 1 ),P_SFX_NAM VARCHAR( 5 ),P_T



To see the whole post, download it here
Labels (2)
3 Replies
root
Creator II
Creator II

The tWriteJsonField component seems a little lacking on features while working with complex json objects. I have tried using a custom Talend Component "tJSONDoc" ( https://github.com/jlolling/talendcomp_tJSONDoc)

The documentation can be a little confusing in the beginning.
HTH

PS: I am still learning this component, and so far, I have had multiple success overall using this component in creating complex objects.
Sudhee_Maximus
Creator
Creator
Author

Hi ,

I am not able to find the solution with this , could anyone explain me how to import this object and work on it pls ...

root
Creator II
Creator II

Can you try installing the custom component? https://community.talend.com/t5/Design-and-Development/How-to-Install-Custom-Components/td-p/120495

 

The github page I shared has the documentation. I would suggest you try installing the component and then checking out the documentation. Thnx.