Optimal way to merge two arrays based on a common field?

Hey @soso_pkhakadze Welcome to the community!

Here is the easiest and optimal way to combine arrays. To do this, Follow this steps:

  1. Iterate 1 array ideally with more items

  2. Use JSON aggregator with final array or JSON structure with combined items by clicking on Add in Data structure options and then add your sample json in generate option and save the structure. After that create mappings as shown in screenshot with the use of map function.

  3. You can copy and replace items based on your mapping : {{first(map(66.array2; "age"; "email"; 68.email))}}

  1. If needed, you can parse the JSON aggregated and When you run this part again, you will get desired output with combined items

This will help in merging 2 Arrays based on common key as “email”

Best,
@Prem_Patel