Combining collections based on value

Hi all,

I have two arrays which I want to combine. The first one contains an email adress (=Address) and an ID (=conversationID).

The second array also includes an email adress (=Email (E)). I want to add the id from the first array and add it to the 2nd array when the email match. So I don’t want to add a new collection in the 2nd array but want to add the value of the id in the corresponding collection of the 2nd array.

So the outcome should be:

Email (E): ronald.koo…
1e mailing (O): Ja
2e mailing (T):
3e mailing (Y):
4e mailing (AD):
Row number: 938
Conversation ID: AAQkADMxNWNmYWM3LTYy…

Sidenote is that the number of items in the arrays can vary from time to time.

Hopefully someone knows how to deal with this.

Cheers

I hate to be the bearer of bad news bad what you ask is not easy (if it is even doable) to achieve with Make. It has a lot of capabilities but this functionality isn’t one of them.

1st of all what you have is not 2 arrays. It is 2 arrays with nested dictionaries with more nested dictionaries inside of them.

In order to combine elements of 2 arrays you have to “flatten” the data into text and then create new arrays from it. Bring in the complexity of the nested dictionaries into the problem and it becomes heavily complicates.
Just for reference, to combine 2 arrays into a collection of arrays while linking the items 1-1 you have to do the below and in contains a lot of slicing and splitting.

My suggestion is doing some custom code to achieve what you need.

If you or someone else intends to try and complete it with modules, here is what i made so far for testing as a refference.
blueprint (11).json (13.1 KB)

Happy to see if someone figures a quick way to achieve this!

1 Like

You definitely inspired me after which I found a solution. Instead of a text aggregator I used a ‘parse to json’ module. The only downside to this whole solution is that it will cost me an operation for each imported email, it is what it is…

Cheers for helping out and going through all the trouble of setting up a scenario yourself!

1 Like