How to merge results from multiple YouTube search iterations into one array?

:bullseye: What is your goal?

To get 1 single array for all the IDs.

:thinking: What is the problem & what have you tried?

I’m building an automation where I provide a list of search phrases, then for each phrase the scenario queries YouTube and retrieves up to N video IDs. After that, the videos are analyzed and a summary is emailed to me.

My issue is the following:
For example, if I start with 3 search phrases and request up to 5 results per phrase, Make runs the iteration 3 times, and I end up receiving 3 separate emails—one per phrase. What I want instead is to merge all results into a single array, so that I get one combined list of 15 videos (in one email), not separate operations.

What is the correct way to “collapse” all iterative outputs into one array before sending the final email?

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

YouTube IA news.blueprint.json (59.3 KB)

Welcome to the Make community!

You are probably using too many aggregators.
Try deleting these, and setting the source module of the last aggregator to the second or first.

You are also using the split function incorrectly.

It should look something like this:


I’d recommend going through the Make Academy if you haven’t yet!

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Learn Make

How-Tos

Useful to Know

Hope this helps! If you are still having trouble, please provide more details.

@samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

1 Like

Thank you so much for your help — everything you suggested worked perfectly.

I also appreciate your recommendation to go through Make Academy (by the way, that´s a fantastic course). I’m indeed going through it, but as you probably can guess, even completing the Advanced level doesn’t necessarily mean that all the knowledge has settled in — there is really a lot to absorb. In my opinion, the ideal approach is to take the course more than once and work on a real automation case in parallel, something that you personally need. That’s what I’m doing now.

Now I have a follow-up question.

In my first module (Set multiple variables), I intentionally provided 2 identical search terms. I would like to understand how I can remove duplicates later, so that any duplicate videos are filtered out. (The reason is that I’m planning to use a long list of search phrases, and if 2 different search phrases return the same video ID, I don’t want to process or analyze those videos twice).

In addition, after the first HTTP > Make a request module, I added a “Limit items” module to trim the results and keep only the number of videos I need. I noticed that even when I specify the maximum number of results in the YouTube API request, sometimes the API still returns 25 results per search phrase.

Could you please explain why this happens and how to properly deduplicate video IDs in this scenario?

Thanks again for your support!

YouTube IA news.blueprint-2.json (62.7 KB)

No problem, glad I could help with "How to merge results from multiple YouTube search iterations into one array?"! :slight_smile:

1. Which was the most helpful post in this thread?

The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep this forum organised. :folded_hands:

This marks the topic as solved, so that others can:

  • save time when browsing the latest activity on the forum, and
  • quickly jump to the solution in this topic

To do this, simply click the checkbox at the bottom of the post that is the most helpful in answering your question.

a screenshot of post menu options at the bottom of each post

:link: Here’s a magic link to a list of your other “unsolved” topics: status:unsolved

2. Have you learnt something new?

Do bookmark this topic so you can easily find and return to this topic in future.

a screenshot of bookmark link at the bottom of the topic

:link: Here’s a magic link to a list of your bookmarks /my/activity/bookmarks

3. Have a different/follow-up question? Start a new topic.

Creating a new topic for each question makes it easier for others with the same problem to search for answers. You are also more likely to receive help sooner as new topics are displayed first on the forum’s “new” page!

Hope this helps! If you are still having trouble, please provide more details.

@samliew

1 Like