# Loop/Repeat until the result is empty

**URL:** <https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296>\
**Category:** Questions\
**Created:** [March 16, 2025, 11:43am UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296 "2025-03-16T11:43:02Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Subingsubing](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@Bryan\_Subingsubing](https://community.make.com/u/Bryan_Subingsubing)\
**Post date:** [March 16, 2025, 11:43am UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/1 "2025-03-16T11:43:02Z")

</div>

I have an API which scrapes the serper dev and paginates it until the result is empty. The problem is that serper dev has pagination in which case i want to iterate the page until i get the array result as empty then i will stop scraping. I want also that all the results from different pages will be saved as one array then be sent to webhook response.

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [March 16, 2025, 11:57am UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/2 "2025-03-16T11:57:32Z")

</div>

Welcome to the Make community!

If the API returns the number of pages in the API, or the total number of items, you should be able to use the Flow Control “ **Repeater** ” module.

For more information, see [https://www.make.com/en/integrations/builtin](https://www.make.com/en/integrations/builtin), and [https://www.make.com/en/help/app/builtin](https://www.make.com/en/help/app/builtin) in the help centre.

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<div class="post-metadata">

**Author:** ![Bryan\_Subingsubing](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@Bryan\_Subingsubing](https://community.make.com/u/Bryan_Subingsubing)\
**Post date:** [March 16, 2025, 12:44pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/3 "2025-03-16T12:44:11Z")

</div>

It doesnt return the number of pages unfornutaly so i really need to loop every page and save every result of the page until the result is empty. So for example, in every page there are 10 results, and you wait until a page is empty then the scraping will stop and i should save all the result from different pages and send it back using webhook response.

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [March 16, 2025, 12:47pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/4 "2025-03-16T12:47:41Z")

</div>

What about the total number of items and page size?

For more information, see [Master Pagination in Make – Retrieve All Data from APIs](https://academy.make.com/courses/AdvancedC03)

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<div class="post-metadata">

**Author:** ![Bryan\_Subingsubing](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@Bryan\_Subingsubing](https://community.make.com/u/Bryan_Subingsubing)\
**Post date:** [March 16, 2025, 12:49pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/5 "2025-03-16T12:49:05Z")

</div>

There is also no total number of results. like if you query something for page 1, it will just give you 10 results per page. then you need to go to http request again for page 2 to get another 10 results until there is no more result for a certain page.

---

<div class="post-metadata">

**Author:** ![Bryan\_Subingsubing](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@Bryan\_Subingsubing](https://community.make.com/u/Bryan_Subingsubing)\
**Post date:** [March 16, 2025, 12:51pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/6 "2025-03-16T12:51:25Z")

</div>

This is my current workflow

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/1/21277a0af03172e332a714994557d63a43313c02.png)

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [March 16, 2025, 12:54pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/7 "2025-03-16T12:54:11Z")

</div>

## Example

Here is an example of how your scenario could look:  
[![Screenshot_2025-03-16_200342](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/1/5/157ee39f8e555abf3965b0ac8ab904a052de21f0.png)](https://samliew.com/make-expert?Referrer=Make)

This is just an example. Your final solution may or may not look like this depending on your requirements.

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<div class="post-metadata">

**Author:** ![Bryan\_Subingsubing](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@Bryan\_Subingsubing](https://community.make.com/u/Bryan_Subingsubing)\
**Post date:** [March 16, 2025, 1:02pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/9 "2025-03-16T13:02:41Z")

</div>

Can you please check the workflow i sent here. I’m having a problem because since i have a repeater for example i set it from 1 to 20. then it will have 20 operations but my problem is that for webhook response, only the operation 1 is being sent back to clay. How can i do that all the bundles from different operations will be stored first then i’ll send them all to webhook response.

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [March 16, 2025, 1:33pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/10 "2025-03-16T13:33:53Z")

</div>

## Setting the Correct Aggregator Source

You need to set the “ **Source Module** ” field of the aggregator to where the bundles are coming from. This is usually an **Iterator** module, but can also be a search/list/repeater module.

 ![](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/6/5/658850f6135a12cb99f684ea85b83a529e11b97d.png)

For more information, please refer to the [Make Academy](https://community.make.com/t/make-academy-course-overview/29699).

## Combining Bundles Using Aggregators

Every result (item/record) from trigger/iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, you’ll need to use an aggregator of some sort.

[Aggregators](https://www.make.com/en/help/modules/aggregator.html) are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the [**Array aggregator**](https://www.make.com/en/help/tools/flow-control.html#array-aggregator) module. The next popular aggregator is the [**Text Aggregator**](https://www.make.com/en/help/tools/tools.html#text-aggregator) which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.

You can find out more about the other types of aggregator modules here:

- [Array aggregator](https://www.make.com/en/help/tools/flow-control.html#array-aggregator)
- [Text aggregator](https://www.make.com/en/help/tools/tools.html#text-aggregator)
- [Numeric aggregator](https://www.make.com/en/help/tools/tools.html#numeric-aggregator)
- [Table aggregator](https://www.make.com/en/help/tools/tools.html#table-aggregator)
- [JSON aggregator](https://www.make.com/en/help/tools/json.html#aggregate-to-json)
- [CSV aggregator](https://www.make.com/en/help/apps/file-and-document-management/csv.html#create-csv)
- [Archive (ZIP) aggregator](https://www.make.com/en/help/apps/built-in-apps/archive.html#create-an-archive-973677)
- _other app-specific aggregators_

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<div class="post-metadata">

**Author:** ![Bryan\_Subingsubing](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@Bryan\_Subingsubing](https://community.make.com/u/Bryan_Subingsubing)\
**Post date:** [March 16, 2025, 2:22pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/11 "2025-03-16T14:22:12Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/a/5a33d41a3e37d538076fecee04d6d634ea49f953.png)  
This is my current scenario. As you can see my problem is that during the initial loop, it will pass the result of the operation 1 quickly to the webhook response so meaning the remaining operations will not be sent anymore to clay.

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [March 16, 2025, 2:37pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/12 "2025-03-16T14:37:41Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/c/c/cc4e0800760cf880cef4caecfedf88fef3482938.png)

See [https://academy.make.com/courses/IntermediateC01](https://academy.make.com/courses/IntermediateC01)

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<div class="post-metadata">

**Author:** ![Bryan\_Subingsubing](https://avatars.discourse-cdn.com/v4/letter/b/898d66/32.png) [@Bryan\_Subingsubing](https://community.make.com/u/Bryan_Subingsubing)\
**Post date:** [March 16, 2025, 3:04pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/13 "2025-03-16T15:04:02Z")

</div>

So i need to switch the place of array aggregator and the repeater? I used the repeater to as the iterator for my page because i used it like this:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/9/596218a197cd0107dc7f1bca31d67a84c1f5d2b7.png)

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [March 16, 2025, 3:32pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/14 "2025-03-16T15:32:44Z")

</div>

No. Please see the answer two posts up about the Aggregator Source.

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/make/original/1X/9786f7887a39f4a0fef4d09346ab5b54ce20222b.svg) [@system](https://community.make.com/u/system)\
**Post date:** [April 15, 2025, 3:33pm UTC](https://community.make.com/t/loop-repeat-until-the-result-is-empty/75296/15 "2025-04-15T15:33:09Z")

</div>

This topic was automatically closed because it's resolved or inactive. Please, start a new topic.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
