How to extract several values from an array in Make.Com?

Suppose I have the following data structure:

"tasks": 
    "results: {
        items": [
                            {
                                "type": "organic",
                                "rank_group": 1,
                                "rank_absolute": 1,
                                "domain": "www.upwork.com",
                                "title": "What Is AI Automation? Explore Applied Uses and ...",
                                "description": "AI automation uses AI techniques like machine learning algorithms, natural language processing (NLP), and computer vision to process and learn from large ...",
                                "url": "https://www.upwork.com/resources/ai-automation",
                                "breadcrumb": "https://www.upwork.com › Resources › Articles"
                            },
                            {
                                "type": "organic",
                                "rank_group": 2,
                                "rank_absolute": 3,
                                "domain": "www.ibm.com",
                                "title": "What is Intelligent Automation?",
                                "description": "Intelligent automation combines AI and automation technologies, enabling automation of low-level tasks within your business.",
                                "url": "https://www.ibm.com/topics/intelligent-automation",
                                "breadcrumb": "https://www.ibm.com › topics › intelligent-automation"
                            }
        ]
    }
}

I want to extract only the “title”, “description” and “url” fields from all the items.

Right now I’m using the Array Aggregator with the following formula:

{{map(3.tasks[].result[].items; "title"; "description")}}

But this only returns the titles, not the description. How do I make it return all the values: title, description, and url that I need?

And also an extra question (in case you know), how do I add a character (e.g. \n) that would separate the values parsed via the map function?

Thanks!

Welcome to the Make community!

The map function only allows you to select a single property.

If you want more than one property (an array of collections), then you will have to use an Iterator-ArrayAggregator combo (or a single DumplingAI or CustomJS module to save on operations).

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

— @samliew

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

Hey @samliew — thank you, but it doesn’t work for me. Adding an iterator just creates an array of bundles and it’s even more complex than before.

I only managed to go this far:

But I need the data structure to be like this:

i am not sure but if you are trying to get just the values of the key value pair using iterator

here is a way

this gives this

1 Like

Thank you! And how do I then group those bundles together? I just need an array list of values in the end… Thanks!

The only way I managed to make it work is through this rather convoluted sequence of iterators and arrays. I think it would be great if Make.Com allowed some Javascript modules without having to use an external CustomJs service. It just makes the workflows too bloated and takes too much time to create something that could be coded in 1 minute.

If anyone knows of an easier way to make this happen, please, do let me know.

The module I receive the data from is DataForSEO (Google search results) and I just need to have an array of combined title, description and url values.




1 Like

Nice approach this also works.

You can also use flatten function on the array.

1 Like

Can I suggest the Make for Make Newbies Video Series I: All About that Data – you will learn a ton about managing data structures that will help you. You can get each set of key/values from the array using map() you can set them into one set multiple variable step and then use merge() to merge the resulting arrays together.

Thank you for the advice, I’ll check this out!

The thing is that I’m a software developer and all those limiting data structures seem very annoying because I could code what I need in 30 seconds. Why doesn’t Make.Com have a custom Js module in their toolbox (without me having to subscribe to an external service), that would enable me to do what I want without having to watch the videos…

But that’s crazy that I have to put 4 transformers before getting the results… isn’t there a feature request anywhere on Make.Com forum where people are asking about the ability to run their own Js code? That would be so useful! Even for somebody who’s not a developer, they could achieve what I spent hours on in 1 minute just asking Claude, ChatGPT or V0 to write the code for them.

There are some useful comments here: https://www.make.com/en/platform-ideas/p/code-javascript-python-php

If you want to use raw JS to manage the data I suggest trying n8n.io – that may be more to your liking.

Thanks for the advice! And how do both Make and n8n compare to Zapier? Would be curious to hear about your experience.

The reason I’m using Make is that I’m preparing the workflows for our customers to use. That’s why I’m trying to set it up here. If it were up to me, I wouldn’t touch it after seeing how convoluted its data structures are. I could code in seconds what takes hours here. Ridiculous. I mean look at my workflows above. How many times do I have to assemble and disassemble an object to get the right structure… Until they offer such limited functionality those nocode tools will not take off.

1 Like

@alex.newpath You find that funny? :slight_smile:

There are limited emojis to respond with so I chose that one but it was more of a smirk than a laugh. Make uses regular JSON for data structures just like any other coding system. There are certain manipulations of data that can be difficult at the start and it may seem convoluted, but in the end it is just like any other development system. There are many ways to accomplish something, and the learning curve is steep.

I think for people who have development expertise Make can seem convoluted, so that’s why I suggested a system that has more coding like n8n. I would not suggest Zapier because in many ways it is much less powerful thank Make. You can even install n8n at no cost in your own docker instance and run it off your own VPS.

It may be worth it to do some learning in the Make Academy and with some time you may find it to be quite elegant, but for certain data structure manipulations it does require several modules although certain array structures can be very powerful esp when nested to accomplish things that multiple modules would.

–
Alex Sirota

:heart_on_fire: Check out Make for Make Newbies Video Series :heart_on_fire:

My Solutions on Make Community