Connecting an AI employee to Google Sheets, in both directions
An AI employee can start when your team adds a row to a sheet, and write its results back as new rows. How to connect it, set up the sheet and avoid duplicate rows.
Part of the guide AI employees
An AI employee in xMap Flows works with Google Sheets in two ways. It can read a sheet, starting a run whenever your team adds a row, and it can write to a sheet, adding each result as a new row or updating the row it already wrote. You connect the Google Sheets app once, paste the sheet's link into the block, and keep a tidy header row so every column becomes a named field.
This guide is for operations, sales and analyst teams who already live in spreadsheets and want an AI employee to work alongside them rather than replace the sheet. It covers connecting, reading, writing, a worked example, the mistakes that cause duplicate or missing rows, and the order of blocks to use.
Connecting the app
- Open Connections in the app and add Google Sheets. You sign in with the account that can open the sheet.
- The connection is personal: it belongs to you, and only the flows you own use it. A colleague who builds their own AI employee connects their own.
- In a block, paste the sheet's link or its ID. xMap sees only the spreadsheets you paste or the ones it creates for you, not the rest of your files.
- If you do not have a sheet yet, the block's list offers to create a new spreadsheet, with your fields as the header row.
The help article Google Sheets, Docs and Drive walks through the screens.
Reading: start when a row is added
The New rows trigger watches one tab of a sheet and checks it every 5 minutes, 15 minutes or hour. Each row added below the last one it saw becomes an item, and each column becomes a field named after its header. Columns called lat and lng (or latitude and longitude) give the row a position, so the next blocks can look around it.
- The first check only counts the rows already there. It does not run on your whole history.
- A large paste is read in pages of up to 500 rows a run, and the rest follow at the next check.
- Keep the header row in row 1 and do not rename columns once the flow uses them, or later blocks lose the field.
Writing: results as rows
The Google Sheets app block writes what the AI employee found. Add Row appends one row per item, filling each column from a field, such as {{name}} or {{phone}}. Find or Create Row first looks for the item in a column you choose and adds it only if it is not there, saying which row it found. A new row takes the look of the sheet, so a formatted table stays formatted.
You can also send a single result to a sheet by hand from the Results page, which is handy while you are still deciding what a flow should write.
A worked example
Here is a made-up setup. A field sales team in Cape Town keeps a sheet called Prospects, where reps paste a business name, an address and its position. The AI employee is told to look up each new row, add its phone, website and rating, count the competitors within 500 metres, write a one-line note on fit, and write all of that back on a second tab called Enriched. When a rep adds 14 rows after a trade fair, the Enriched tab fills within the next check, and the reps sort it by fit score before making calls.
Mistakes that cause trouble
- Writing back to the tab you read. If the employee adds rows to the same tab New rows watches, it starts itself again. Write to a second tab.
- Using Add Row every day for the same places. A daily search returns many of yesterday's places. Use Find or Create Row, or put Only new before the sheet, so each place is written once.
- Headers with spaces or symbols that change. A field is matched by its column name. Pick plain names and keep them.
- Expecting the whole drive. xMap works only on sheets you paste or it created. Paste the link of an existing sheet rather than looking for it in a list.
The order of blocks
A typical sheet-to-sheet AI employee looks like this:
- New rows: the Prospects tab, every 15 minutes.
- Nearby places: counts competitors around each row's position.
- xMap LLM: scores fit and writes a short note.
- Only new: makes sure a business is passed on once.
- Google Sheets, Find or Create Row: writes each one to the Enriched tab.
- Email: optional, a note to the team when the batch is done.
What lands in the Team inbox after each run is a short daily note from the employee: how many rows it read, how many it wrote and the strongest fits, with the sheet one click away. The template Score new leads from a sheet is built this way.
Questions
Can my whole team use the same connection?
No. A Google Sheets sign-in belongs to one person and only that person's flows use it. Each colleague connects their own, or shares the sheet with the person who owns the flow.
How quickly does a new row start the flow?
New rows checks the sheet every 5 minutes, 15 minutes or hour, as you choose. A table in My data starts the flow as soon as rows are added.
Will it write the same place twice?
Not if you use Find or Create Row, or put Only new before the sheet block. Add Row alone appends every item it receives.
Can it read sheets I did not paste?
No. xMap only works on the spreadsheets whose link you paste and the ones it creates for you.
Templates that do this
Read next
More on ai employees and automation · Every article · Templates