Hi, I’m using an API to fetch data. This data comes into 21 operations
When I then try to put this data in a spreadsheet it adds each operation in a separate row. Can someone help me how to merge the 21 operations so it sits in one single cell on one row? So it can be comma separated or just as a text in that cell (instead of 21 separate cells).
Really appreciate the help.
Welcome to the Make community!
Aggregators
Every result (item/record) from a list/search/match module 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 are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and can apply to many use-cases like building of JSON, CSV, HTML.
There are other types of aggregator modules, click the below links to find out more:
Array Aggregator – mapping multiple bundles into a complex field
The Array Aggregator module is very powerful because it allows you to build a complex array of collections for a later module’s field to map multiple items (collections) to it.
This is done using the “Target structure type” of an Array Aggregator module.
Here is an example:
As you can see, the “Map” toggle on complex fields are used when you have an array. You can easily build an array variable to map to a future module’s field, by using an Array Aggregator module and select the “Target Structure Type” as the future module’s field you have mapped the array into.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!
Thank you so much for your reply. Really appreciate it.
Unfortunately I can’t get it to work…
I’m unable to create a target structure type. Here you can see the 21 requests, I selected “Data” as aggregated fields from the HTTP module.
Then I selected which row I want to update with the Array Data:
But in the spreadsheet it just adds all 21 cells. I’ve highlighted the row where the data should go (column E row 338). What I want it to do is to paste all the data in column E row 338 (the combined 21 operations).
Looks like the multiple bundles are generated by the trigger module, so you should set the aggregator’s Source Module to that.
If you need further assistance, please provide the following:
1. Scenario Blueprint
Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.
2. Output Bundles of Modules
Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
A. Upload as Text File
Save each bundle contents in your text editor as a bundle.txt
file, and upload it here into this discussion thread.
B. Insert as Formatted Code Block
If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:
-
Method 1: Type code block manually
Add three backticks ```
before and after the content/bundle, like this:
```
content goes here
```
-
Method 2. Highlight and click the format button in the editor
Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.
Following these steps will allow others to assist you here. Thanks!
— @samliew
P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!