How to aggregrate results of HTTP Request

Hello everyone! I’m doing a Google search on the first HTTP Request that sends me a “nextPageToken” which means there’s more stuff on the next page! So far so good, but I need to loop until it doesn’t return this “nextPageToken” parameter.

However, at the end of the flow I need to aggregate all the results of the requests! Does anyone know how to do this?

Hey !

As the API will return only one big result with a token pointing to the next page, your loop node will only execute once and stop after the first iteration, you don’t actually need the loop node in your case.

For the aggregations of the results, I didn’t find a better way than to stock them in a database in the loop and retrieve them at the break for further process (if there’s a better way, i would be interested how it would be implemented haha).

Let me know if this helps ! :slight_smile:

I discovered a much simpler way to do it!

In the HTTP Request pagination I used the “pageToken” parameter in the body, in my case I was making a request to the Places API

{{ $response.body.nextPageToken }}

and in the stop condition I used

“Other”
Complete Expression

{{ $response.body.nextPageToken.isEmpty() }}

1 Like

Oh i didn’t know this one ! Nice !