Upload the CSV file to the NetSuite File Cabinet programmatically or manually; note the file internal ID
Define a CSV import map in NetSuite (Setup > Import/Export > Saved CSV Imports) that maps CSV columns to record fields; save the import map and note its script ID
In SuiteScript 2.x, require the N/task module; create a task using task.create({ taskType: task.TaskType.CSV_IMPORT }) and set the importType, mappingId, linkedFiles, and queueId properties
Submit the task with task.submit() which returns a task ID; use task.checkStatus({ taskId: <id> }) in a follow-up script execution to poll for COMPLETE or FAILED status
Retrieve import result details from the task status response; on failure, access the error log file linked in the status to identify row-level errors
Known gotchas
The CSV import task runs asynchronously; submitting the task and immediately checking status often returns PENDING — build a polling loop with adequate delay rather than assuming the import is done
CSV import maps are version-sensitive to the record type schema; after a NetSuite release that changes field IDs, existing maps may silently drop unmapped fields rather than erroring
The N/task CSV import does not support all record types that the UI import wizard supports; verify that your target record type is available in the task.ImportType enum before building the integration
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp