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 :slight_smile:

Thank and regards,
Sri

Hi Sri,

Please find the attached pipeline. It might help you.

sequence of the data_2018_12_18.slp (8.6 KB)

Thank you very much for your response Anil. I have modified your pipeline to my problem and attached.
You can see the change in sequence in the Record2 after the join. I need to re-sequence it back to how it was in the right JSON generator. How can I do that?sequence of the data_2018_12_18 (1).slp (7.9 KB)

Thanks and regards,
Sri

Hi Sri,

Please check the attached pipeline.

image

sequence of the data_v1_2018_12_19.slp (12.8 KB)

That is super cool. Thank you very much Anil.