The Scenario
You manage field service scheduling for a company that dispatches fifty technicians per day. Your operations sheet in Google Sheets has technician home addresses in column A and job site addresses in column B — fifty rows. Every morning you need driving duration, distance, and a summary of the first few route steps for each assignment, filled into columns C, D, and E, before dispatch at 7 AM. The ops coordinator who used to handle this left three weeks ago and you have been doing it manually since.
The bad version:
- Open Google Maps fifty times, type each origin-destination pair, note the driving time and distance, paste them into the sheet one row at a time.
- Get to row twenty and realize you made a copy-paste error two rows back — a job site address ended up in the wrong row.
- Realize you need turn-by-turn summary data (not just duration) and Google Maps does not make that easy to extract into a spreadsheet at scale.
Fifty rows. Forty-five minutes. Every morning.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Google Sheet. It reads the origin and destination addresses from each row, calls the Mapbox Directions API for each pair, and writes duration, distance, and route steps back into the sheet — all fifty rows in one pass.
For each row with an origin address in column A and destination address in column B, use Mapbox directions to get the driving route and write duration in minutes into column C, distance in km into column D, and the first 3 turn instructions into column E.
What You Get
- Column C with driving duration in minutes for each row.
- Column D with total driving distance in kilometers.
- Column E with the first three turn instructions concatenated — for example, "Head north on Oak St, Turn right onto I-94 W, Take exit 45B."
- Any row where either address fails to geocode gets "ROUTE FAILED" in column C so dispatch can fix the address before the driver heads out.
What If the Data Is Not Quite Ready
Several technician home addresses are outdated — you want to validate them first
Three technicians moved recently and the addresses in column A may be stale.
Before getting directions, geocode all addresses in column A using Mapbox and flag any that return a confidence score below 0.7 in column F as VERIFY ADDRESS. Then get driving directions for all unflagged rows and fill duration, distance, and turn instructions into columns C, D, and E.
You want to flag assignments where the drive is over 45 minutes as a dispatch concern
Anything over 45 minutes represents a scheduling inefficiency and should be flagged for the operations manager.
Get Mapbox driving directions for all 50 origin-destination pairs in this sheet. Write duration in minutes into column C, distance into column D, and the first 3 turns into column E. Then add a column F flag that says LONG DRIVE for any row where column C is greater than 45.
The job sites are coded by district and you want drive times grouped by district
Column C already has a district code. You want the average drive time per district at the bottom of each group.
Get Mapbox driving directions for all rows (origin in column A, destination in column B). Write duration into column D and distance into column E. Then group rows by district code in column C and add a subtotal row after each group showing the average drive time for that district.
Full pipeline: validate addresses, get directions, flag long drives, and produce a dispatch summary tab
Check all addresses in columns A and B for obvious formatting errors (missing city or state) and flag those rows in column F as NEEDS FIX. For all other rows, get Mapbox driving directions and write duration into column C, distance into column D, and the first 3 turns into column E. Flag any row where duration exceeds 45 minutes in column G as LONG DRIVE. Then create a new tab called Dispatch Summary with columns: Technician Address, Job Site, Duration, Distance, Flag — sorted by Flag first, then Duration descending.
One prompt handles validation, directions lookup, flagging, and summary report creation.
Try It
Get the 7-day free trial of SheetXAI and open your dispatch sheet tomorrow morning — paste in the origin and destination columns and ask SheetXAI to pull Mapbox driving directions for every row before your team clocks in. The route optimization article covers the multi-stop sequencing problem if a single technician is visiting several sites in order. The Mapbox hub has the complete workflow list.
