How to make ChatGPT analyze only Top 5 items from an array in Make?

Hi community :waving_hand: I’m working on a TikTok Data Scraping (competitor analysis) project using Make, Apify, Airtable, ChatGPT, and Google Docs. Here’s what I’ve built so far:

:white_check_mark: What’s working:

  • I’m using Apify Actor to scrape TikTok data (15 videos across 3 keywords)

  • I store all results in Airtable successfully

  • ChatGPT module (GPT-4o-mini) is used to generate a structured marketing analysis report

  • The final output is exported nicely into Google Docs

  • Hashtags and video fields are shown correctly in the report

:red_exclamation_mark: What’s not working (my key issue):

ChatGPT always generates analysis for all 15 videos, even though I asked it to analyze only the Top 5 videos with the highest engagement (Views + Likes + Shares + Comments + Saves)

:magnifying_glass_tilted_right: What I’ve already tried:

  1. Tried sending the entire array ({{25.array}}) into ChatGPT and asked it to analyze Top 5 only → ChatGPT still summarizes all videos.
  2. Tried formatting with {{25.array; JSON}} → GPT responds with “Invalid JSON or missing data”
  3. I don’t have access to Tools > Code (JavaScript function) because it’s not available in my Make plan.
  4. Using filter modules between Airtable → ChatGPT doesn’t help because it checks one item at a time, not whole array.

:bullseye: What I want:

  • I want to pass all 15 video records into ChatGPT, but instruct it to analyze only the Top 5 based on the highest total engagement.
  • Ideally, I want to solve this without using JavaScript, or find a workaround inside Make if possible.

Has anyone here managed to do something similar? Or is there a way to sort & reduce the array inside Make before passing it to ChatGPT?

Would love any suggestions or insights :folded_hands:
Thanks in advance!
Thananit

To get only the first 5 items from an array you can use the Slice function



{{slice("Your Array here"; 0; 5)}}

Hey there,

from the screenshot it looks like you are sending 10 videos one at a time instead of the entire array in one go. Can you share the different module setups at the moment?

Welcome to the Make community!

The module “Get Dataset Items” returns one bundle per result. This is a “List” type module. This means each resulting item will pass through each future module once, individually.

Combining Bundles Using Aggregators

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

You can find out more about the other types of aggregator modules here:

Question: Which is the best aggregator do you think you’ll need for your use-case?

Example

Here is an example of how your scenario could look like:
Screenshot 2025-06-13 185311

This is just an example. Your final solution may or may not look like this depending on your requirements and actual data.

For more information, see “Mapping with arrays” in the Help Centre. You should also do the Make Academy, which also covers the use of Iterators & Aggregators.

Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

@samliew

1 Like

Thank you for your advised.

No problem, glad I could help you with “How to make ChatGPT analyze only Top 5 items from an array in Make?

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help as newer questions are displayed higher on the forum’s “new” page.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

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

Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

@samliew