# Plan a field sales day around drive time and neglected accounts

> Pick a date, a starting point and a radius, then build a sequenced day of customer visits that lands straight on your calendar.

- Workflow type: app
- Services: Geolocation, HubSpot, Google Calendar
- Categories: Sales, Operations
- Published: 2026-08-24

## What it does

- Turns a date, a starting address like home or a hotel, and a radius into a ranked list of your own accounts nearby, ordered so the closest ones you have neglected longest float to the top, with drive time and days since last contact on every row.
- Lets you click accounts to build a stop list, drag them into the order you want, and watch running drive time and total miles update live, with an Optimize order button that finds a shorter sequence and shows the route leg by leg.
- Sends the finished day to your calendar as one event per stop with the address and an arrival window, then lets you log what happened at each visit back to your CRM as a note, with an optional follow up task.
- Includes a Prep my day button that writes a short pre visit brief for every stop covering talking points, open deals and recent company news, and closes the day with a summary of driving time versus time actually spent in front of customers.

## What you'll need

- A HubSpot account where your companies have street addresses filled in and an owner assigned to each one
- A Google Calendar login for each rep, so everyone's day lands on their own calendar
- Maps, drive times and directions are built in, so there is nothing extra to sign up for

## Prompt

Build an app my field reps open every time they plan a day on the road. It is a planning workbench for a day that does not exist yet: the rep picks a date, a starting address such as home or a hotel, and a radius, and the app turns that into a ranked list of nearby accounts, a sequenced stop list, calendar events, and CRM writeback. Each rep signs in and only ever sees the accounts they own in HubSpot, and any calendar event the app creates goes on that rep's own calendar.

On the plan setup view the rep enters the date, the start address and the radius in miles. Convert the start address to coordinates with the geolocation Forward Geocode operation. Then pull the rep's accounts from HubSpot with Search Companies, filtered so hubspot_owner_id matches the signed in rep. Resolve the rep to their HubSpot owner record with List Owners by matching their email address. Request the address properties along with the activity recency properties such as notes_last_contacted, notes_last_updated and hs_last_sales_activity_timestamp, which are what the days since last activity column is computed from.

Geocode each company address once with Forward Geocode and store the coordinates in the app's own storage keyed by company id, so a rep opening the app tomorrow does not re-geocode the whole book. Before any drive time call, filter candidates using a straight line distance calculation from the start coordinates, drop anything outside the radius, and cap the list to the nearest fifty accounts. Only then call Calculate Distance Matrix with the start point as the single origin and those capped accounts as destinations. This cap is load bearing: Distance Matrix bills per origin and destination pair rather than per request, so an uncapped candidate list gets expensive quickly.

Rank the resulting candidates so the closest and most neglected accounts float to the top, combining a short drive time with a high number of days since last activity. Each row shows the company name, the address, the drive time and distance from the start point, and the days since last activity, with a visible flag on accounts that have gone longest without a touch.

The rep clicks candidate rows to add them to a stop list on the same screen, and can drag stops to reorder them. Keep a running total of drive time and total miles that updates live as stops are added, removed or reordered. An Optimize order button re-sequences the stop list into a shorter route by calling Calculate Distance Matrix across the selected stops, then pulls a Get Directions leg between each consecutive pair so the rep can see the actual leg by leg route with its distance and duration. Persist the plan so the rep can close the app and come back to it from the road.

A Send to calendar button writes one Google Calendar event per stop with Create Event on the rep's own primary calendar. Each event carries the company name in the title, the street address in the location field, and an arrival window derived from the day start time plus accumulated drive time and a configurable dwell time per visit.

After each visit the rep logs the outcome from the same screen. Write that outcome straight into HubSpot with Create Note associated to the company, and offer an optional follow up that creates a HubSpot task with Create Task carrying a subject, due date and priority. Also keep a copy of every logged visit in the app's own storage, so the app has its own visit history to display and to feed the briefing agent.

Add a Prep my day button that kicks off a background agent across every stop on the plan. For each stop the agent reads the company record with Get Company including its properties and associations, pulls that company's open deals with Search Deals, reads back the prior visit outcomes the app has stored for that account, and researches recent news about the company on the web. It then writes a short pre visit brief covering talking points, the open deals and their stages, and anything notable that changed recently. Each brief lands in two places: back onto the HubSpot company record as a note via Create Note, and into the app's storage so the rep can read the briefs stop by stop on the plan screen. Show per stop status while the agent runs so the rep can watch briefs arrive rather than waiting on a blank screen.

One important constraint on that agent: HubSpot exposes no documented operation for reading the body of existing notes, so do not attempt to read note content back. The account history signal comes from the company activity timestamps, the open deals from Search Deals, and the visit outcomes this app has stored itself.

End the day with a summary view: total driving time versus time actually spent in front of customers, stops planned versus stops logged, and each account visited with its logged outcome. Show that driving versus selling split prominently, because moving the ratio toward customer time is the entire point of ranking accounts this way.

Rules to enforce throughout: a rep only ever sees and writes to accounts they own, calendar events are only ever written to that rep's own calendar, company geocodes are cached rather than recomputed on every page load, and Calculate Distance Matrix is never called on more than the capped candidate set.

## How to customize

- Change the default search radius and how many nearby accounts get considered before drive times are worked out
- Set what time the day starts and how long a typical visit runs, which is what shapes the arrival window on each calendar event
- Adjust how the ranking balances a short drive against a long gap since the last visit, or narrow the candidate list to a lifecycle stage, industry or deal size

## FAQ

### Will each rep only see their own accounts?

Yes. The app matches whoever is signed in to their owner record in HubSpot and only ever shows companies assigned to them. Calendar events are written to that rep's own calendar, and notes and tasks are filed under their name, so two reps using the app never see or touch each other's book.

### Will this work on HubSpot Free?

Yes for the core of it. Companies, notes and tasks are standard CRM records available on free plans. What actually matters is your data hygiene: accounts need a street address to be mapped, and an assigned owner so the app knows whose day it is. Deal information on the pre visit briefs will only be as complete as the deals you track.

### Do I have to plan the whole day before I can start driving?

No. The plan is saved as you build it, so you can sketch three stops in the morning, send those to your calendar, and add more later from the road. Reordering or adding a stop updates the running drive time and mileage straight away.

### Can I change the order after the app optimizes it?

Yes. Optimize order is a suggestion, not a lock. You can drag any stop into a different position afterwards and the totals recalculate. Reps usually override it for things like a customer who only takes morning appointments.

### Does mapping every account get expensive?

It is deliberately built not to. The app remembers the map location of each account instead of looking it up again every time you open the screen, and it narrows candidates down to the nearest fifty by straight line distance before working out any real drive times. That keeps the costly step to a small, capped list.

Use this prompt in General Input: https://www.generalinput.com/prompts/plan-a-field-sales-day-around-drive-time-and-neglected-accounts