Logic

Sort and limit

Sort and limit puts the items in order and can keep only the first ones: the 10 best rated, the 20 nearest, the highest fit scores. Sort by fit score, rating, reviews, name or any field an earlier block adds. Items without the value go last, so an unrated place never tops the list.

In the editor: Puts the items in order, and can keep only the first ones: the 10 best rated, the 20 nearest, the highest fit scores. Items without the value go last.

Settings

Sort by

Pick one

What to put the items in order by.

  • Fit score The score an xMap LLM or Jev block writes (fit_score, or any field ending in score).
  • Rating The rating out of 5 from Map business scan or POI Intelligence.
  • Reviews The number of reviews, when the data has it (live map listings rarely do).
  • Name The name, or the company or job title for items without one. Sorted as people read: capitals and accents ignored, 10 after 9.
  • Another field Any field by its name, for example depot_km from Find nearest, rain_total_mm from Weather forecast, or a field from your own table.

Field name

Text

A field an earlier block adds, as named in the results. Click one under Fields coming in.

Needed before the flow can run.

Order

Pick one

Highest first for scores and ratings; lowest first for distances, or A to Z for names.

Numbers: highest first puts the biggest number first. Names and text: Z to A.

  • Highest first (Z to A)
  • Lowest first (A to Z)

Keep

Pick one

Keep every item, only the first few, or a number you choose.

  • All of them Only the order changes.
  • The first 5
  • The first 10
  • The first 20
  • The first 50
  • The first 100
  • A number I choose Type how many to keep, from 1 to 5,000.

How many

A number

Needed before the flow can run.

What comes out

Each item that leaves the block carries these fields, to use in the blocks after it as {{field}}.

The items, in the new order

Nothing is added or changed; with a Keep setting, only the first ones go on.

  • every field: Unchanged. The order is what the next blocks see: an email lists them in this order, a CRM gets them in this order.
  • fit_score: Here, the field the items were sorted by.

How to use it

Sales

The 10 best prospects every morning

A software company scores every new shop in Johannesburg with xMap AI, but its reps can only call ten a day.

Before: The email listed 60 places in the order they were found.

With the flow: The email lists the ten best, best first, each with the reason for its score.

Logistics

Stores closest to each depot

A distributor wants the 20 new stores nearest a depot for this week’s trial deliveries.

Find nearest adds depot_km to each store; Another field: depot_km, Lowest first, keeps the closest.

Hospitality

Top rated hotels for a client shortlist

Government and cities

The wettest days first

A city drainage team wants the forecast days with the most rain at the top of the morning email.

Real estate

Rank candidate sites

A developer scores each plot sent by its brokers and wants the three best in front of the board.

Before: Analysts ranked the plots in a spreadsheet every Thursday.

With the flow: The three best arrive scored and ranked as soon as a broker sends a plot.

Telecom

Busiest sites first

A telecom operator ranks candidate tower sites by footfall before a field survey.

Sort by Another field, footfall_daily: the busiest sites first. A site with no footfall data yet goes last.

Marketing agencies

A to Z for a client report

Names sort as people read them, so a report a client skims is easy to search by eye.

Good to know

  • Items without the value go last, whatever the order, and keep the order they came in.
  • A field is sorted as numbers when most of its values are numbers (a decimal comma is read too), otherwise as text with capitals and accents ignored.
  • If none of the items has the field you name, the step fails and lists the fields that do reach the block.
  • To keep only items above a value, use Filter; to keep the best few, use Sort and limit. They work well one after the other.
  • Put it last before an email, a map, a sheet or a CRM: they all keep the order.
  • Sort and limit is free and runs the same in the editor’s preview and in real runs.

Works well with

  • xMap LLM: Tell the AI what to do in plain words.
  • Filter: Keeps only the items that match a rule.
  • Find nearest: For each place, finds the nearest of your own points from a CSV you upload, for example the nearest ambulance to each accident or the nearest branch to each new lead, and adds its name and the distance.
  • Remove duplicates: Keeps one of each item when the same one arrives more than once, for example from two searches that overlap.
  • Calculated field: Adds fields worked out from the others: a number, a text or a yes/no.
  • Email: Sends one email per run with all the items, or one email per item.
  • Show on a map: Shows the results as points on a map, with the area of interest.
  • Map business scan: Finds businesses on online maps live: name, category, rating, address, phone, website and whether it is open.

Templates that use it

And 274 more in the template gallery.

Stories with it

Help articles

Guides and terms

Industries that use it

B2B sales · Retail & franchise · Restaurants & cafes · Real estate · FMCG & distribution · Marketing & agencies · Recruiting & staffing · Logistics & delivery · Government & cities · Investors & consultants · Healthcare & pharma · Hotels & tourism · Banking & lending · Energy & EV · Construction & facilities · Telecom · Automotive & mobility · Education & training · Agriculture & food supply · Fitness, beauty & wellness · Law & professional services · Media & publishing · Events & venues · Non-profits & humanitarian · Security & emergency services · Environment & climate · Ports & shipping · E-commerce & D2C · Manufacturing & industrial · Software & tech · Sports clubs & leagues · Pet care & veterinary · Home services & trades · Food delivery & quick commerce · Airports & aviation · Mining, oil & gas · Public transport · Water & waste utilities · Insurance · Fishing & aquaculture

Try it

Build a flow with Sort and limit on the home page, no account needed, or book a call. Try it live