Calculated field
Calculated field adds new fields to every item, worked out from the fields it already has: a score out of 100, a grade A, B or C, a label made of the city and the name, the distance to your warehouse, the days since a date. Write one per line as name = formula; later lines and later blocks (Filter, Sort, an email, your CRM) can use the new fields.
In the editor: Adds fields worked out from the others: a number, a text or a yes/no. One per line, as name = formula. Later lines and later blocks (Filter, Sort, Email) can use the new fields.
Settings
Fields to add
Text, several linesUp to 10 lines. Each one is a name (letters, numbers and _, starting with a letter), an equals sign and a formula. A line can use the fields made by the lines above it.
One per line: name = formula. Use {{field}} for a field. Numbers: + - * / % ^, round(x, 1), floor, ceil, abs, sqrt, min, max. Text: join with &, and lower, upper, trim, len, left, right, replace(text, find, with), contains(text, part). Choices: if(test, then, else), and, or, not, = != < <= > >=, default(x, fallback). Also distance(lat1, lng1, lat2, lng2) in km, today(), days_since(date).
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}}.
Each item, with the new fields
Every item goes on with all its fields, plus one for each line, named as you wrote it.
score_100: From score_100 = round({{rating}} / 5 * 100).grade: From grade = if({{rating}} >= 4.5, "A", if({{rating}} >= 4, "B", "C")).label: From label = upper({{city}}) & ": " & {{name}}.km: From km = round(distance({{lat}}, {{lng}}, 52.52, 13.41), 1): the straight-line distance in km.is_cafe: A test gives Yes or No, ready for Filter: is_cafe = contains(lower({{category}}), "caf").age_days: From age_days = days_since({{first_seen}}), with Only new before it.
How to use it
Grade A places only
A sales team wants a simple A, B or C on every new cafe and only the A grades in its morning email.
Another field: grade is A, in Filter, reads the field this block adds.
Distance to the warehouse
A distributor receives new sites by webhook and wants them in a sheet, nearest the warehouse first.
Before: Someone measured each site on a map before the weekly call.
With the flow: Each site arrives with km and the sheet is already in order.
A route label for each shop
Text joined with & makes one column the route planners sort and read at a glance.
A merchant score out of 100
A payments company turns the AI’s fit score and the rating into one number its sales team trusts.
How long a job has been open
days_since works on any date field, here first_seen from Only new.
Rain in words
A city team wants each forecast day labelled Heavy, Light or Dry in the morning email.
Distance between each incident and a site
A telecom operator wants to know how far each road closure is from its main switching site.
Make a yes or no field first, such as near = if(km < 3, "yes", "no"), then Filter keeps near is yes.
Good to know
- Formulas are worked out by xMap, never run as code, so they are safe in any flow, shared or not.
- Functions: round, floor, ceil, abs, sqrt, min, max; lower, upper, trim, len, left, right, replace, contains; if, and, or, not, default; distance (km, in a straight line), today, days_since. Text is joined with &.
- If a formula cannot be worked out for an item (a missing rating, text where a number is needed), that field is left empty and the run says how many. The rest of the item goes on.
- A formula that cannot be read is shown as a problem in the block before you run.
- Up to 10 lines per block, and texts of at most 10,000 characters. For more than that, Custom code runs your own JavaScript.
- A decimal comma is read as a number: 4,5 is 4.5.
- Calculated field is free and runs the same in the editor’s preview and in real runs.
Works well with
- Filter: Keeps only the items that match a rule.
- 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.
- Branch: Splits items in two.
- Custom code: Your own JavaScript, for what the other blocks cannot do: change, add or drop fields, filter and reshape the items.
- xMap LLM: Tell the AI what to do in plain words.
- 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.
- Email: Sends one email per run with all the items, or one email per item.
- HubSpot: Powerful CRM that offers tools for sales, customer service, and marketing automation.
Templates that use it
- Score every neighbourhood for a new branch: Every block of your city scored for a new supermarket, the 20 best on a map.
- Stores competing with each other: Your stores that sit within 1 km of each other, with the people around them.
- Where to open a delivery kitchen: Where to open a delivery kitchen: people per restaurant in every block of the city.
- Where to open my next cafe: Areas with many residents and few cafes, scored for your next cafe.
- Neighbourhood facts and a blurb for every listing in my sheet: Add a listing to a sheet and get its neighbourhood facts and a walkability score.
- Where to put micro-fulfilment hubs: Where to put micro-fulfilment hubs: most people per warehouse first.
- Children per school, block by block: Children per school in every block of the city, the most crowded first.
- Competitor density around each site: People per competitor around each of your sites, ranked.
- Expansion committee pack, every month: A monthly expansion committee pack: every block scored, the best 20 investigated, approved, mapped.
- Where to open sample collection points: The blocks of your city with the most adults and the fewest labs, scored and approved every month.
- Where seniors need home care most: The blocks where the most seniors live with the fewest home care providers, every month.
- Where to open serviced apartments: The blocks where business travellers need serviced apartments, scored and approved.
- Branch network review: which branches the area needs: A monthly review of which branches their area needs, with a note for the committee.
- Unbanked hotspots for my agent network: The most populated blocks with the fewest banks and agents, every month.
- Fast charger sites where drivers already stop: Places where drivers already stop, with the fewest chargers, scored and approved.
- Week ahead at my solar and wind sites: The week ahead at every solar and wind site, with the best days for maintenance.
- Where demand on the grid is growing: Where new buildings are adding load to the grid, with a planning note every month.
- Where to open the next phone shop: The most populated blocks with the fewest phone shops, scored and approved.
- Phone retail footprint across India: Phone shops across two big cities, by operator, brand and independent, with a report.
- Where to put scooter and bike hubs: The blocks for scooter and bike hubs, near stations and people, approved every month.
- Where to open a nursery: The blocks with the most young children and the fewest nurseries, scored and approved.
- Where families need after-school activities: The blocks with the most children and the fewest after-school activities.
- Open day ads: the right blocks and the right words: The blocks to target with open day ads, and the ad line for each, approved.
- Irrigation plan for my fields, every morning: An irrigation plan for each field from the week's heat and rain.
And 46 more in the template gallery.
Stories with it
- A second ramen shop where the lunch crowd is (Restaurants)
- Water on the shelves before the heat arrives (Supermarkets)
- New stores where people reach for reading glasses (Eyewear retail)
- The credit committee starts every week on fresh sales (Mortgage lending)
- Cash machines that follow the street, not last year (Retail banking)
- Where Melbourne’s young families have no childcare (Urban planning)
- The right hall for every free coding evening (Adult training)
- The evidence that got a school its crossing (Primary school)
- Full shelves before the heatwave (Pharmacy)
- The next clinic, where the people are (Family clinics)
- The on-call team, already there (Hospitals)
- From crash to garage in one call (Car insurance)
Industries that use it
Retail & franchise · Restaurants & cafes · Real estate · FMCG & distribution · Marketing & agencies · Logistics & delivery · Government & cities · Investors & consultants · Healthcare & pharma · Hotels & tourism · Banking & lending · Energy & EV · 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 · E-commerce & D2C · Manufacturing & industrial · Sports clubs & leagues · Pet care & veterinary · Home services & trades · Food delivery & quick commerce · Airports & aviation · Mining, oil & gas · Public transport
Try it
Build a flow with Calculated field on the home page, no account needed, or book a call. Try it live