Merge two Lists with Key Value in one List

I’m new here and just started programming with Dynamo.
So I’m still a beginner, but I want to go deeper into programming with Dynamo because I’m very interested in this topic.
I have a problem with two lists that I want to combine.
I have two lists with different numbers of values, the Liste1 being the key list.
Here the “Wert(x)” is decisive and should contain all attributes of Liste2 wich also contains “Wert(x)”, but several times.
I have to combine and group all values ​​from Liste2 with the “Wert(x)” with the Liste1 with the “Wert(x)”.
I have attached a picture for illustration.

My question is now how can I make this automatically fpr all values in the lists …

Thank you in advance for your help

Share DYN file, and we’ll try to help.

Hello Vladimir,
many thanks fpr your response. Attached you will find the dyn file.
Thank you for your help …2List-Combine.dyn (27.3 KB)

Well, maybe like this?

Many thanks Vladimir, but this is unfortunately not the result that I need . I attached another picture, It’s very difficult to describe what i need. I hope this would better describe my problem …

You can use the first item in each list (List.FirstItem) as the keys for List.GroupByKey. That will get all your sublists merged into separate W1 and W2 lists. Then you can just use List.UniqueItems to remove the duplicate values.

If you want duplicate values in some cases, another option is to use List.Deconstruct to separate the keys and the values and then add the keys back into the list after they’ve been combined.

Thank you, I will test your solution.

2List-Combine.dyn (21.4 KB)

Test this

Wow Vladimir, exactly what I need … many thanks to you and Nick! Perfect!