cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping help required.

Former Member
0 Kudos

Hi,

Can you help me for how to get this output from mapping:

Source input:

-


ExtID,FName,LName,Email&UID,CodeS

TJones8646,Ted,Jones,test,System User Name

TJones8646,Ted,Jones,test1at123.com,Work Email

TJones8646,Ted,Jones,1112223456,Work phone number

TJones8646,Ted,Jones,PO98,NT user ID

Output required:

-


ExtID, FName, LName, Email, UID

TJones8646,Ted, Jones,test1at123.com,PO98

Thanks,

Shankar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
Source input:
ExtID,FName,LName,Email&UID,CodeS

TJones8646,Ted,Jones,test,System User Name
TJones8646,Ted,Jones,test1at123.com,Work Email
TJones8646,Ted,Jones,1112223456,Work phone number
TJones8646,Ted,Jones,PO98,NT user ID

Output required:
ExtID, FName, LName, Email, UID

TJones8646,Ted, Jones,test1at123.com,PO98

Going by your post its a file to file scenario with CSV at both source and target side.

Approach:

Create a single structure for both source and target like this :

Root Node (1...n)

...ExtID(1..1)

...FName(1..1)

...LName(1..1)

...Email&UID(1..1)

...CodeS(1...1)

In Adapter file content conversion don't reject the offset as you need column name to be present at target side too.

Mapping :

1.For first three fields its 1 to 1 mapping.

2.You must be having certain logic based on which you are selecting the last two values(here test1at123.com,PO98)

Please elaborate on the logic for those two fields. Anyways you need to use node functions for these two fields(read splitByValue & may be collapseContext...Once we know the logic we can work on the approach).

Regards

Soumen...

Former Member
0 Kudos

HI soumen,

ur in almost my view.. but logic? thanks for your time..

- uma

Former Member
0 Kudos
.. but logic?...

Hi

There was a slight miss on my part in understanding your query I guess.For the last two fields you can use UDFs(Use contexts option).

UDF Logic :

Email&UID(EU) and CodeS(CS) would be your input fields to the UDF. Don't forget to use removeContext here.

for(i=0;i<EU.length;i++)

{

if( CS of i * == "Work Email")

{

String value= EU<i>;

}

}

result.addValue(value);

Another UDF with similar logic for UID. Just that the "if" condition will look for key word NT user ID .

  • Note : Use square brackets instead of "CS of i" . Couldn't post it that way due to posting restrictions.

P.S : Even the structure for target should be different now(I misinterpreted the target result) and in source FCC set document offset to 1.

Regards

Soumen...

Answers (0)