12 Replies Latest reply on Feb 25, 2021 5:17 AM by Prakash Jain

    Iterate from Source 1 Json and Source 2 Json and update whichever array element is greater

    Vishal Singh Active Member

      Hi Team,


      I have a requirement where I am having source 1 which is a json structure and under it has address which is an array element with multiple array elements. As the address can be multiple.


      Similarly I have a Target source(Source 2) which is also a json structure and under it has address with multiple array elements. Picture shown.


      I need to iterate over source 1 and source 2 to find out which address element has latest "updateDate" from source1 and overwrite the information in source 2. If the "updateDate" is not greater then ignore that array element and go to next array element of address.

      src1, src2, expected output


      So can you please help me on how to iterate over source1 address array elements and fetch a record and compare with source 2 record's "updateDate" and then update if required else loop through other elements and perform the same.


      Your help is greatly appreciated!!