How to create tXMLMap nested loops

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

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch