Configure the map generated in the previous procedure.
Procedure
-
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.
-
Drag and drop the input
streetAddress
, city
,
state
and postalCode
elements on the
corresponding output elements.
-
Drag and drop an AgConcat expression on the output
homePhoneNumber
element.
-
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.
-
Drag and drop an Equal function on the
Filter argument of the
SimpleLoop function.
-
Drag the input
type
element on the First
Value argument.
-
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.
-
Right-click the AgConcat function and click
Copy to copy the entire expression.
-
Right-click the output
mobilePhoneNumber
and click
Paste.
The AgConcat expression is copied to the
Value tab of the mobilePhoneNumber
element.
-
Right-click AgConcat and click Expand
All to see the whole expression, then double-click the
Constant function and change the value to
mobile.
-
Repeat the previous steps to copy the AgConcat
expression to the output
workPhoneNumber
element and change the
value of the Constant expression to
work.
-
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