Forum Discussion

SriVinayaga's avatar
SriVinayaga
New Contributor II
7 years ago

Sequence of the data changes after Left Outer Join if there is no value for an object in first record, but present in second record

Hi All,

This is my first post and I am pleased to be part of this community.

I have been working on a scenario now.

A document has 2 records. For some of the fields in the records I need to do a lookup in tables (1 for each field) to transformation. So I Split the document using JSON Splitter and made a copy for each lookup, at each lookup step, I am joining using Left Outer Join, The problem is, if the sequence of the records is as follows
1st record:
{
Given Name: XYZ
Last Name: ABC
YOB: 1987
}
2nd Record:
{
Given Name: MNY
Last Name: EFG
Age: 30
YOB: 1987
}

The output of the Left outer join is as follows

1st record:
{
Given Name: XYZ
Last Name: ABC
YOB: 1987
}
2nd Record:
{
Given Name: MNY
Last Name: EFG
YOB: 1987
Age: 30
}

Age object is pushed to the bottom in the second record and this causes failure in my pipeline as the objects are not as per sequence to the structure given for validation.

Note: Age is not a mandatory field, but if present it should be next Last Name.

If this is the normal behavior of the Left Outer Join, then please let me know how can i re-sequence the output as expected?

I have tried Sort and Mapper snaps by providing the sequence, but no luck.

Expecting you masters help on this 🙂

Thank and regards,
Sri

4 Replies