Output HTTP Bundles in Google Sheet

Hey, I have the following goal:
I want to trigger an AI search with the tool you.com based on a search term. You.com is connected via an API interface. This also works well. I use the HTTP module “Make a request”. I receive a total of 10 “hits” in the output. Each hit is a response from You.com from a source. So I have a total of 10 different facts with 10 different sources.
I want to save all sources in a Google Sheet.
The problem is that only the last source is saved in Google Sheets and all other 9 sources are overwritten.

So far, the only approach I have is to attach an iterator afterwards, which translates the “hits” into “bundles”, but then saving in Google Sheets still doesn’t work.

How do I solve the problem?

Hello @Pascal_Burda and welcome to the Make Community!

For this I believe you will need an Iterator on your Hits array.
You can then follow the Iterator with a Google Sheets Add a Row module.
This will run the Add a Row module once for each Hit, so that’d be 10 times.

The more efficient way to update it would be to Aggregate the results of the Iterate into a values object using a Text Aggregator, which can be used with a Google Sheets Make an API call module against the batchUpdate endpoint. This would use a single Operation instead of 10, but it’s more difficult to implement and prone to errors if there are certain characters in the data.
You can see more posts related to using batchUpdate here or here.