Need a way to list top results

:bullseye: What is your goal?

Airtable GPS search Module

:thinking: What is the problem & what have you tried?

So I have a Airtable module that collect all my clients, I push that to a Iterator to bundle then a GPS module to take my location ( perfectly sorted in GPS ) and match distance of the veneus in distance form me.After the GPS module I need to sort the top 3 clients nearest to me in kilometer nearest to me by the GPS ) in a WA text to my rep. I have tried everything but found no way to so send only 3 results in the Text Aggregator nor by distance, any advice or am I daft?

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

1 Like

The missing piece is that you need to sort the array explicitly and then limit it before it reaches the Text aggregator or WhatsApp. I hope this helps you!

Hey there,

firstly → what is the Airtable module producing as output and what are you iterating over?

Second → its either an array aggregator or a text aggregator, not both.

And lastly → you always aggregate the module that produces the extra bundles. Your screenshot is not very clear, but it looks like this is the airtable module, it is definitely not the gps module.

1 Like

Thks Karmic, let me try and appreciate your quick response!

Thks so muchStoyan, the air table proces clients based on keywords, generate a list with latitude and longitude refined by their needs, then it goes to airtable, this goes to my GPS module which logs my sales person current position and calculate the distance from his position to those suitable spitted out by airtable. But now I cannot give him a list of 50 suitable suppliers, he needs 3, so I need from my GPS to sort the 3 closest to his location, send it to the text aggregator to send him the 3 closest. Possible or not

1 Like

Sorry if I mis

spelled, been on this for 11 hours…

Caught a error Karmic, Make.com does NOT have a standalone “Sort” module!

So how do you sort?

You can use sort() function Array functions - Help Center

1 Like

Yeah I dont think you need that iterator. So have the GPS module after the Airtable one. Then have the Aggregator module return one array (with the airtable module as the source). Then have another iterator with a sort() function applied to the resulting array so you get them sorted by distance, and then on top of that put a slice() function to get the top 3 items from the array. Then after that have the text aggregator build the complete text string with the three items.

Awesome Stoyan and make sense, I tried to find a slice logic but could not find it?

“What specific Make.com module or tool do I use for the slice() function to get the first 3 items? I’ve checked Set Variable, Tools, and Array Aggregator but don’t see a slice option. Is it called something else in Make.com?”

It’s a function, not a module. You can find it with the rest of the array functions: Array functions - Help Center

Many thanks guys sorted, just me from the edge of insanity. Last thing, my text aggregator output look like this: {“state”:“error”,“errorType”:“emptyDependency”,“value”:“Traditional pub with an upstairs bar, their classic décor gives the place a proper old Edinburgh feel.”,“isStale”:false} - in mapping it shows next to the Airtbali button ( is retrieved from Airtable ) as {collection} and tried a set variable but not sure how to map it to get clean text.

Looks like this question has been solved, and you’ve posted a follow-up question in another thread.

Let’s continue the discussion here: Clean text output from Text aggregator