How to create tXMLMap nested loops

Highlighted
Six Stars

How to create tXMLMap nested loops

 

I have the below flow, and I would like the userGroup to be a loop as well according to data that's coming from another database lookup, Can you point me to the best way to approach this, I'm not able to do it right now.

 

Your help is appreciated.

 

image.png

image.png


Accepted Solutions
Six Stars

Re: How to create tXMLMap nested loops


All Replies
Six Stars

Re: How to create tXMLMap nested loops

Good morning,

 

Can you guys help with this.

 

Thanks!

Six Stars

Re: How to create tXMLMap nested loops

Can anyone please help with this?

 

Thank you!

Six Stars

Re: How to create tXMLMap nested loops

 

I followed the example in here: https://community.talend.com/t5/How-Tos-and-Best-Practices/prepare-XML-with-multiple-loop-in-same-le...

But the problem is when it gets to the lookup part it won't bring all the user groups, it will bring only one row. 

 

here is the flow:

image.png

 

here is the tCMLMap_3:

image.png

 

Here is the tMap_1

image.png

 

Here is the expression to replace the string:

row10.userGroup==null?
row9.payload.replaceAll("<UserGroups>WIRECODE_PLACEHOLDER</UserGroups>", "")
:row9.payload.replaceAll("<UserGroups>WIRECODE_PLACEHOLDER</UserGroups>", row10.userGroup)

 

Here is tTeradataInput_2:

image.png

 

Here is the resulted user node in the XML:

image.png

 

Here is the expected user groups:

image.png

 

is there something wrong with the way I do the join?

 

Your help appreciated!

 

 

 

Six Stars

Re: How to create tXMLMap nested loops

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now