The Scenario
You are a CRM manager at a mid-sized e-commerce company. Your data team ran a SQL query against the transactions database and exported 300 contact IDs who made a purchase in the last 30 days into a Google Sheet. The campaign team wants to email these recent buyers with a product education sequence.
The problem: Benchmark Email does not know these 300 people are "recent buyers." They are just contacts in a list. You need to create a named segment in Benchmark Email — "Recent Buyers" — scoped to the right list, with exactly these contact IDs.
You have to do this before the campaign goes out tomorrow morning.
The slow version:
- Log into Benchmark Email
- Navigate to segment management
- Create a new segment manually
- Try to add 300 contact IDs one by one through the UI (Benchmark's segment editor expects filters, not ID lists)
- Give up on the UI, look for a bulk import option
- Find the API documentation
- Try to write an API call by hand
- It is 11 PM, you have a segment with 47 contacts, and you are out of ideas.
The fast version is one prompt.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent inside your spreadsheet that reads the contact IDs and creates the segment in Benchmark Email for you, so you do not have to figure out the API or fight the segment UI.
Open the SheetXAI sidebar and type:
Create a Benchmark Email segment named "Recent Buyers" in list ID 11223344 using all contact IDs listed in column A of my sheet. Write the new segment ID back to cell B1 when done.
SheetXAI reads all 300 contact IDs, calls the Benchmark Email API to create the segment, adds the contacts, and writes the segment ID into B1. The campaign team can start targeting it tomorrow morning.
What You Get
A named segment in Benchmark Email containing exactly the contacts in your sheet:
- "Recent Buyers" segment — created in list ID 11223344 with all 300 contact IDs
- Segment ID in cell B1 — write it down or use it in the next prompt to build the campaign
- No UI work — you did not touch the Benchmark Email segment editor
The segment ID is the handoff. Give it to the campaign team and they can target it directly in their next Benchmark Email send, without you needing to stay involved.
What If the Data Is Not Quite Ready
Contact ID exports from SQL queries are rarely perfectly formatted.
When the contact IDs have extra whitespace or are mixed with header text
The SQL export included a header row, and some IDs have trailing spaces from the export.
Before creating the segment, clean column A by removing the header row, stripping any leading or trailing spaces from each ID, and dropping any blank rows. Then create a Benchmark Email segment named "Recent Buyers" in list ID 11223344 using the cleaned contact IDs. Write the segment ID to cell B1.
When you want to split the 300 contacts into two segments by purchase value
The SQL export also has purchase totals in column B. You want one segment for buyers under $100 and one for buyers at $100 and above.
Create two Benchmark Email segments in list ID 11223344: "Recent Buyers — Standard" for contacts in column A where column B is under 100, and "Recent Buyers — High Value" for contacts where column B is 100 or more. Write the two segment IDs to cells C1 and D1 respectively.
When some contact IDs do not exist in Benchmark Email
The SQL query pulled all transaction records but some customers may not be in the email list at all.
For each contact ID in column A, check whether the contact exists in Benchmark Email list ID 11223344 before adding them to the segment. Write "added," "not found," or "already in segment" to column B for each row. Create the "Recent Buyers" segment using only the contacts that exist. Write the segment ID to cell C1.
When you need the segment created plus a confirmation report for the campaign manager
The campaign manager wants to know the segment was set up correctly before scheduling the send.
Create a Benchmark Email segment named "Recent Buyers" in list ID 11223344 using contact IDs in column A. Write the segment ID to cell B1. Then in a Confirmation tab, write a short summary: segment name, list ID used, number of contacts added, number of IDs skipped (not found), and the date of creation. That is the confirmation report for the campaign manager.
The pattern: build the segment and generate the handoff documentation in one prompt, so the campaign team has everything they need without a follow-up.
Try It
Get the 7-day free trial of SheetXAI and open a sheet with Benchmark Email contact IDs in column A, then ask SheetXAI to create the segment. The Benchmark Email integration is included in every SheetXAI plan. See also how to bulk-copy contacts between lists or the Benchmark Email in Google Sheets overview.
