Back to Mailtrap in Google Sheets
SheetXAI logo
Mailtrap logo
Mailtrap · Google Sheets Guide

Create Mailtrap Custom Contact Fields from a Google Sheets Definition List

2026-05-13
4 min read
See the Excel version →

The Scenario

You are a marketing engineer setting up a new Mailtrap account for a product launch. Before you can import any contacts, you need 10 custom contact fields created: things like subscription plan, trial start date, company size, and industry vertical.

You have a Google Sheet with the field names in column A and their types (text, number, date) in column B. The fields need to exist in Mailtrap before the contact import runs at 9 AM tomorrow.

The slow version:

  • You open the Mailtrap UI, navigate to contact fields
  • You click "Create field," enter the name, pick the type, save
  • You go back, click "Create field" again, enter the next name
  • Row seven, you fat-finger the field name and do not notice until row ten
  • You delete it, recreate it, realize the IDs are now out of sequence and your import script hardcoded the IDs
  • You push the import to 11 AM to fix the script.

The fast version is one prompt.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Google Sheet that reads the field definition rows and creates each one in Mailtrap, so you never have to touch the field creation UI.

Open the SheetXAI sidebar and type:

For each row in this sheet, create a Mailtrap contact field using the field name from column A and type from column B. Write the created field ID into column C for each row. If any row fails, write "ERROR" into column C with the reason.

SheetXAI reads all 10 rows, creates each field, and writes the new field IDs back to column C. Your import script has the IDs it needs without any manual copy-paste.

What You Get

All 10 custom fields created in Mailtrap with IDs confirmed in the sheet:

  • Column C — the Mailtrap field ID for each created field
  • "ERROR" rows — flagged with the reason so you know exactly which ones to investigate
  • No manual UI work — you never opened the field creation screen

The IDs in column C are the source of truth for your import script. Pull them programmatically from the sheet and your hardcoded ID problem does not exist.

What If the Data Is Not Quite Ready

Field definition sheets often have cleanup needs before you can create. SheetXAI handles them in the same prompt.

When field names have inconsistent formatting

Some names have spaces, some have underscores, and Mailtrap expects a specific format.

Normalize all field names in column A to use snake_case (lowercase with underscores). Then create one Mailtrap contact field per row using the normalized name from column A and type from column B. Write the created field ID into column C.

When you have duplicate field names

The sheet was assembled from two sources and some names appear twice with different types.

Deduplicate rows by field name in column A, keeping the first occurrence. Then create one Mailtrap contact field per remaining row. Write the created field ID into column C.

When some types need to be mapped from your internal naming to Mailtrap's accepted types

Your sheet uses "string" and "integer" but Mailtrap expects "text" and "number."

For rows where column B contains "string," treat it as type "text." For rows where column B contains "integer," treat it as type "number." Then create one Mailtrap contact field per row using column A and the mapped type. Write the created field ID into column C.

When you need to create the fields, confirm them, and output a mapping file for the import script

Your import script needs a JSON mapping of field name to field ID, not just a column in the sheet.

Deduplicate column A by field name. Normalize all names to snake_case. Create one Mailtrap contact field per row using column A and column B type. Write the created field ID into column C. Then write a JSON object into cell E1 where each key is the field name and each value is the created field ID, formatted for direct copy-paste into a script.

The pattern: the field definition sheet becomes the setup artifact. One prompt creates all the fields and produces the mapping your scripts need.

Try It

Get the 7-day free trial of SheetXAI and open any sheet with a field or configuration definition, then ask it to push the setup to Mailtrap. The Mailtrap integration is included in every SheetXAI plan. See also how to bulk-import contacts once your fields are ready or the Mailtrap in Google Sheets overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more