AnsweredAssumed Answered

Logic to find the specific xml element from multiple nodes and set the desired value to destination field.

Question asked by kiran_gopavaram795295 on Mar 7, 2017
Latest reply on Mar 8, 2017 by kiran_gopavaram795295

Hello,
Could anyone please help me with the logic to develop the below scenario?


My requirement is, I would need to set the "NID Number" based on the "NID_TYPE" value as shown from below sample xml.
conditions are:
If there are more than one <wd:NID_G> entries
and
if one of them have the NID_TYPE as "USA-SSN"
then I should set the NID_NUMBER related to USA-SSN type
else NID_NUMBER of IND-UAN/IND-PAN type will be set.

Sample source xml profile:

<wd:Report_Data xmlns:wd="urn:com.workday.report/reportname">
<wd:Report_Entry>
<wd:EMPLOYEE_ID>100000</wd:EMPLOYEE_ID>
<wd:NID_G>
<wd:NID_NUMBER>S11111</wd:NID_NUMBER>
<wd:NID_TYPE>USA-SSN</wd:NID_TYPE>
</wd:NID_G>
</wd:Report_Entry>
<wd:Report_Entry>
<wd:EMPLOYEE_ID>100001</wd:EMPLOYEE_ID>
<wd:NID_G>
<wd:NID_NUMBER>U22222</wd:NID_NUMBER>
<wd:NID_TYPE>IND-UAN</wd:NID_TYPE>
</wd:NID_G>
<wd:NID_G>
<wd:NID_NUMBER>P33333</wd:NID_NUMBER>
<wd:NID_TYPE>IND-PAN</wd:NID_TYPE>
</wd:NID_G>
</wd:Report_Entry>
<wd:Report_Entry>
<wd:EMPLOYEE_ID>100002</wd:EMPLOYEE_ID>
<wd:NID_G>
<wd:NID_NUMBER>U44444</wd:NID_NUMBER>
<wd:NID_TYPE>IND-UAN</wd:NID_TYPE>
</wd:NID_G>
<wd:NID_G>
<wd:NID_NUMBER>S55555</wd:NID_NUMBER>
<wd:NID_TYPE>USA-SSN</wd:NID_TYPE>
</wd:NID_G>
</wd:Report_Entry>
<wd:Report_Entry>
<wd:EMPLOYEE_ID>100003</wd:EMPLOYEE_ID>
<wd:NID_G>
<wd:NID_NUMBER>U66666</wd:NID_NUMBER>
<wd:NID_TYPE>IND-UAN</wd:NID_TYPE>
</wd:NID_G>
<wd:NID_G>
<wd:NID_NUMBER>P77777</wd:NID_NUMBER>
<wd:NID_TYPE>IND-PAN</wd:NID_TYPE>
</wd:NID_G>
<wd:NID_G>
<wd:NID_NUMBER>S88888</wd:NID_NUMBER>
<wd:NID_TYPE>USA-SSN</wd:NID_TYPE>
</wd:NID_G>
</wd:Report_Entry>
</wd:Report_Data>


Destination profile is Flat file and expected output should be as below.

"EmployeeId","NID Number","NID Type"
"100000","S11111","USA-SSN"
"100001","U22222","IND-UAN"
"100002","S55555","USA-SSN"
"100003","S88888","USA-SSN"

 

I am checking Enforce unique option for "EmployeeId" column to eliminate duplicate records from the flat file.

 

Please let me know if need more details.

Appreciate for quick help.

 

Thanks,

Kiran 

Outcomes