Mapping the elements for your Data Integration Job - 8.0

Talend Data Mapper User Guide

Version
8.0
Language
English
Product
Talend Big Data Platform
Talend Data Fabric
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Design and Development > Designing Jobs
Last publication date
2024-03-28

Configure the map generated in the previous procedure.

Procedure

  1. Drag the input customers element on the output row element.

    The firstName, lastName and age elements are automatically mapped, and a SimpleLoop function with a reference to the input customers element is added to the Loop tab of the output row element.

    This looping expression indicates that the map should produce one row in the output for each iteration of the customers element in the input. For more information, see Loop expressions.
  2. Drag and drop the input streetAddress, city, state and postalCode elements on the corresponding output elements.
  3. Drag and drop an AgConcat expression on the output homePhoneNumber element.
  4. Drag the input number element on the AgConcat function.
    This is required because there are several number elements for each customers, and you need to create a single output from them.
    A looping expression using the input phoneNumber loop is generated.
  5. Drag and drop an Equal function on the Filter argument of the SimpleLoop function.
  6. Drag the input type element on the First Value argument.
  7. Drag and drop a Constant function on the Second Value argument, then double-click it, enter home in the Value field and click OK.
    This filter allows you to specify that the homePhoneNumber element should return the value of the input number element in the iterations where the value of type is equal to home.
  8. Right-click the AgConcat function and click Copy to copy the entire expression.
  9. Right-click the output mobilePhoneNumber and click Paste.
    The AgConcat expression is copied to the Value tab of the mobilePhoneNumber element.
  10. Right-click AgConcat and click Expand All to see the whole expression, then double-click the Constant function and change the value to mobile.
  11. Repeat the previous steps to copy the AgConcat expression to the output workPhoneNumber element and change the value of the Constant expression to work.
  12. Save your map.

Results

Your elements are now mapped.
You can use the Test Run option to test the output, and go back to your Job to run it. The output should look like this with the sample input data:
John,Smith,25,21 2nd Street,New York,NY,10021,202-555-0109,202-555-0181,
Jane,Doe,31,19 4th Street,New York,NY,10021,202-555-0178,202-555-0123,202-555-0163