Collection can’t be converted to text for parameter

Good evening, I was doing automation for work, and ran into a problem. I want to display information from an http module connected via API to one service. But, I can’t display all the information from data with one button. I read several forums, and in this case they advised different methods, but in all of them you need to manually write out which elements from the collection you want to take. This option does not suit me, because when checking, even through one module, there is a different amount of information, because of this, it is impossible to predict what information to display.

A clear example, the API that I use is checking different information about business partners. For example, I took a module that shows what cars a person has by the passport code. But, here I ran into a problem. As you can see on the screenshot, the information about each car is in a different collection (collection 1, collection 2), I can easily configure it to display it. But what if a person has 10 cars?

I’m looking for a way to simply ALL the information from data - output in plain text.
for simplicity i simplified my scenario by adding only one module in a separate scenario. because my main scenario has more than 260 modules
Below I add all the necessary information.

Thank you in advance, any tips, any solutions will be very useful. Also, I ask you to write the explanation step by step, because I am new to the world of automation. Thank you

[
    {
        "statusCode": 200,
        "headers": [
            {
                "name": "date",
                "value": "Thu, 10 Oct 2024 17:33:08 GMT"
            },
            {
                "name": "content-type",
                "value": "application/json; charset=utf-8"
            },
            {
                "name": "transfer-encoding",
                "value": "chunked"
            },
            {
                "name": "connection",
                "value": "keep-alive"
            },
            {
                "name": "x-ratelimit-keylimit",
                "value": "5000"
            },
            {
                "name": "x-ratelimit-keyremaining",
                "value": "4601"
            },
            {
                "name": "cf-cache-status",
                "value": "DYNAMIC"
            },
            {
                "name": "report-to",
                "value": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=8Shr%2B0E%2Bsjan9i%2B2Fys0Wq%2FMEC7li5oc8oXLO3SQd6ZuTwAZ6XErAIJ8njGu77pT4E7K7n11MtVbyPYwXgmpmUg1OeD9TuhaWKpUk06ybgNCsW4pFvPkmo3jhR7yfRUKv9vnLE4%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}"
            },
            {
                "name": "nel",
                "value": "{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}"
            },
            {
                "name": "server",
                "value": "cloudflare"
            },
            {
                "name": "cf-ray",
                "value": "8d085a908ee9bf52-DUB"
            },
            {
                "name": "content-encoding",
                "value": "br"
            }
        ],
        "cookieHeaders": [],
        "data": {
            "totalResults": 2,
            "nextPageUrl": null,
            "results": [
                {
                    "operationCode": 440,
                    "operationName": "ПЕРЕРЕЄСТРАЦIЯ ПРИ ВТРАТІ СВIДОЦТВА ПРО РЕЄСТРАЦIЮ",
                    "registrationDepartmentName": "(8001) ВРЕР-1 УДАІ В М.КИЄВІ",
                    "type": "ЛЕГКОВИЙ",
                    "model": "428I",
                    "brand": "BMW",
                    "bodyType": "СЕДАН",
                    "fuelType": "БЕНЗИН",
                    "color": "КОРИЧНЕВИЙ",
                    "makeYear": 2014,
                    "engineCapacity": 1997,
                    "ownWeight": 1525,
                    "totalWeight": 1900,
                    "lastRegistrationDate": "2015-09-29T21:00:00Z",
                    "purpose": "ЗАГАЛЬНИЙ"
                },
                {
                    "operationCode": 440,
                    "operationName": "ПЕРЕРЕЄСТРАЦIЯ ПРИ ВТРАТІ СВIДОЦТВА ПРО РЕЄСТРАЦIЮ",
                    "registrationDepartmentName": "(8001) ВРЕР-1 УДАІ В М.КИЄВІ",
                    "type": "ЛЕГКОВИЙ",
                    "model": "X5",
                    "brand": "BMW",
                    "bodyType": "УНІВЕРСАЛ",
                    "fuelType": "БЕНЗИН",
                    "color": "ЧОРНИЙ",
                    "makeYear": 2012,
                    "engineCapacity": 2979,
                    "ownWeight": 2145,
                    "totalWeight": 2745,
                    "lastRegistrationDate": "2015-09-29T21:00:00Z",
                    "purpose": "ЗАГАЛЬНИЙ"
                }
            ]
        },
        "fileSize": 855
    }
]

blueprint (1).json (59.4 KB)

Hello @Daniel15,
You will need to iterate on your results array in the data collection, then aggregate them depending on what you plan on doing with the information.

Either way you need an Iterator, then inside the Iterator module you need to map in the results array. That Iterator will output a bundle for each of the objects in that array, which is 2 in this case.

Follow the Iterator with some sort of Aggregator.
Use Text Aggregator if you need to combine pieces of text from each bundle into a final piece of text.
Use Array Aggregator if you need everything in an array for any downstream array operations.
Use s JSON Aggregator if you need information from each bundle in a JSON file for use in a later HTTP operation.

2 Likes

Welcome to the Make community!

02ae9331650a88a59ff8e6be4acc6fd658ceb03f

Aggregators

Every result (item/record) from 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 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:

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 —

Getting Started

Help Centre Basics

Articles & Videos

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

1 Like

hey, thanks a lot, but i dont get it, what sense of iterator, if then - its just the same? I mean, later, anyway, they are all separate - just like in the http module, and in the text aggregator module I can’t automatically output everything into one text. And that was my goal, because due to the fact that there can be a different number of results, etc. - so that everything is automatic - I want the entire array to be selected. Is it possible to somehow, using a function or code in the text aggregator module in the text column, tell the module to simply take ALL the information from the http module array “results”, or all the information from the iterator?

Yes in that case you need to click and drag results[ ] into that Text box in your Iterator.

After the Iterator, you put a Text Aggregator.