Use aggregate node for an array in json response?

Below is the Json response from an HTTP request and I want to aggregate ALL the
organic > link - items. Total of 10 items.

I tried to do organic[*].link and appending organic[1].link , organic[2].link , organic[3].link but it just says empty array

"organic": [
  {
    "title": "Apple",
    "link": "https://www.apple.com/",
    "snippet": "Discover the innovative world of Apple and shop everything iPhone, iPad, Apple Watch, Mac, and Apple TV, plus explore accessories, entertainment, ...",
    "sitelinks": [
      {
        "title": "Support",
        "link": "https://support.apple.com/"
      },
      {
        "title": "iPhone",
        "link": "https://www.apple.com/iphone/"
      },
      {
        "title": "Store",
        "link": "https://www.apple.com/store"
      },
      {
        "title": "Careers at Apple",
        "link": "https://www.apple.com/careers/us/"
      },
      {
        "title": "Business",
        "link": "https://www.apple.com/business/"
      }
    ],
    "position": 1
  },
  {
    "title": "Apple Inc. - Wikipedia",
    "link": "https://en.wikipedia.org/wiki/Apple_Inc.",
    "snippet": "Apple Inc. is an American multinational corporation and technology company headquartered and incorporated in Cupertino, California, in Silicon Valley.",
    "sitelinks": [
      {
        "title": "History",
        "link": "https://en.wikipedia.org/wiki/History_of_Apple_Inc."
      },
      {
        "title": "List of Apple products",
        "link": "https://en.wikipedia.org/wiki/List_of_Apple_products"
      },
      {
        "title": "Apple Inc. and unions",
        "link": "https://en.wikipedia.org/wiki/Apple_Inc._and_unions"
      },
      {
        "title": "Apple Park",
        "link": "https://en.wikipedia.org/wiki/Apple_Park"
      }
    ],
    "position": 2
  },
  {
    "title": "Apple Inc. (AAPL) Company Profile & Facts - Yahoo Finance",
    "link": "https://finance.yahoo.com/quote/AAPL/profile/",
    "snippet": "See the company profile for Apple Inc. (AAPL) including business summary, industry/sector information, number of employees, business summary, ...",
    "position": 3
  },
  {
    "title": "Apple Inc. | History, Products, Headquarters, & Facts - Britannica",
    "link": "https://www.britannica.com/money/Apple-Inc",
    "snippet": "Apple Inc. is an American multinational technology company that revolutionized the technology sector through its innovation of computer software, ...",
    "position": 4
  },
  {
    "title": "Apple Inc - Company Profile and News - Bloomberg Markets",
    "link": "https://www.bloomberg.com/profile/company/AAPL:US",
    "snippet": "Apple Inc. designs, manufactures, and markets smartphones, personal computers, tablets, wearables and accessories, and sells a variety of related ...",
    "position": 5
  },
  {
    "title": "Apple Inc. Stock Quote (U.S.: Nasdaq) - AAPL - MarketWatch",
    "link": "https://www.marketwatch.com/investing/stock/aapl",
    "snippet": "Apple, Inc. engages in the design, manufacture, and sale of smartphones, personal computers, tablets, wearables and accessories, and other varieties of related ...",
    "position": 6
  },
  {
    "title": "Apple Inc. (AAPL) Stock Price, News, Quote & History - Yahoo Finance",
    "link": "https://finance.yahoo.com/quote/AAPL/",
    "snippet": "Find the latest Apple Inc. (AAPL) stock quote, history, news and other vital information to help you with your stock trading and investing.",
    "sitelinks": [
      {
        "title": "Profile",
        "link": "https://finance.yahoo.com/quote/AAPL/profile/"
      },
      {
        "title": "Community",
        "link": "https://finance.yahoo.com/quote/AAPL/community/"
      },
      {
        "title": "Statistics",
        "link": "https://finance.yahoo.com/quote/AAPL/key-statistics/"
      },
      {
        "title": "Jim Cramer on Apple Inc...",
        "link": "https://finance.yahoo.com/news/jim-cramer-apple-inc-aapl-092208259.html"
      }
    ],
    "position": 7
  }
],
"places": [
  {
    "title": "Apple Mart Inc",
    "address": "Oak Lawn, IL",
    "cid": "3693611499149146841"
  },
  {
    "title": "Apple Orland Square Mall",
    "address": "Orland Square",
    "cid": "4557159651172982837"
  },
  {
    "title": "Apple Chevrolet, INC",
    "address": "Tinley Park, IL",
    "cid": "3197826610467078861"
  }
],
"peopleAlsoAsk": [
  {
    "question": "What is inc in Apple Inc?",
    "snippet": "The short answer is yes: "Inc.\" in a company name signifies that a business is a legal entity called a corporation or an incorporated business. \"Inc.\" is an abbreviation of \"incorporated.\"",
    "title": "What Does 'Inc.' Mean in a Company Name? | LegalZoom",
    "link": "https://www.legalzoom.com/articles/what-does-incorporated-mean-in-business"
  },
  {
    "question": "Who owns Apple Inc.?",
    "snippet": "The ownership structure of Apple (AAPL) stock is a mix of institutional, retail and individual investors. Approximately 3142.02% of the company's stock is owned by Institutional Investors, 6.18% is owned by Insiders and 5033.36% is owned by Public Companies and Individual Investors.",
    "title": "Who owns Apple? AAPL Stock Ownership - TipRanks.com",
    "link": "https://www.tipranks.com/stocks/aapl/ownership"
  },
  {
    "question": "Why did Apple change to Apple Inc?",
    "snippet": "During his keynote speech at the Macworld Expo on January 9, 2007, Jobs announced the renaming of Apple Computer, Inc. to Apple Inc., because the company had broadened its focus from computers to consumer electronics. This event also saw the announcement of the iPhone and the Apple TV.",
    "title": "Apple Inc. - Wikipedia",
    "link": "https://en.wikipedia.org/wiki/Apple_Inc."
  },
  {
    "question": "Why Apple Inc is called Apple?",
    "snippet": "But in reality, Steve Jobs named the company Apple because he liked the fruit. Steve Jobs followed a fruitarian diet and suggested the name Apple to Wozniak after Jobs visited an apple orchard.",
    "title": "The Apple Logo: History, Meaning, Design Influences, and Evolution",
    "link": "https://www.crowdspring.com/blog/apple-logo/"
  }
],

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @welski , use JMESPath as one of the neat solutions.

2 Likes

Thank you! This work better.
I managed to make it work by using two split nodes but this is more efficient!

Now my next problem is my app extract the content of all the URL;s in the loop and how do I put all the content extracted in 1 output?

If you need to retrieve all the URLs, GET the content of each and assemble it in a single “document” then you do not need to aggregate the URL in the first place. You also do not need a loop unless you have to introduce a delay between the requests of getting content

If I understand what you are trying to do, here’s how it could be done.

The question is what the final (composed) content should look like. That will determine how to concatenate it.

The concatenation itself is a simple thing. Just use Summarize node (Aggregation “Concatenate”). The problem is with the structure of the content and how to treat it with respect to the final outcome.

1 Like

Hi,

Yes I need a delay on extracting the content of URL to not hit the rate limit

Below is my workflow:

The summary seems to be the solution but I do not know where to put it exactly? I put it on done when the loop is finished

Hey @welski , that is exactly right. The Summarize would have to be connected to “done” branch of the Loop node.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.