How to deduplicate/distinct a bundle of collections?

Hello everyone, I’m new to make (begginer). I don’t understand well enough neither agregators and iterators nor the ways to manipulate “collections”.
My problem is after my script I get too many bundles therefore the final Json contains duplicates.
Can you explain me how to : Remove the excess in the Json text or how to remove the excess bundles or how to fix my GSheets value search?
Here is my script.
blueprint (2).json (118.8 KB)

Every offer is contained inside the right supplier information in the “offres” key.

I end up having 8 inputs in my aggregator. I’m trying to Link Offers and suppliers with the “reference” key, present in all rows of the GSheets. For this example I shoud have a Json with 1 supplier for 2 offers twice.


I tried removing the duplicates with a deduplicate or a distinct without success. I get a massive Json when I use the duplicates.

Can you help me please?

Hello!

Unfortunately, your scenario blueprint won’t allow us to see the structure of the 2 Google sheets.

If I understand well, the first google sheets contains a list of suppliers with a unique “reference” key. And the second Google Sheets contains a list of “offers” with ‘besoin technique’, ‘allergenes’ etc (reminds me something :wink:). In this second Google Sheet, you also have ‘reference’ that helps you link the supplier with his offers. Am I correct?

And you want to generate one single JSON with an array of suppliers, and in the details of each supplier, you want an array of offers, right? Or do you want to generate a separate JSON for each supplier? (Both are doable)

If you could provide me with a sample “suppliers” file, a sample “offers” file and a sample target JSON, I could help you build the use-case

Benjamin

1 Like