Importing CSV data

Not all systems have APIs or JSON data export tools allowing for simple data handling. So if you have data from spreadsheets, competitions, forms, or something as simple as a purchased list of customer records, CSV imports might be a suitable backup to get data into your CDXP.

With that in mind, the most common use case for CSV data transfers into a CDXP is for customer data, which leads us to an example for a fictional competition:

[.code] email, marketing opt in, favorite destination
fake@fake.com, true, New York
fake2@fake2.com, false, London
[.code]

Convert your CSV into an NDJSON file

The recommended option! The quickest and easiest way to get your customer profile data into your Hub is to convert it to an NDJSON file using our [.code]csv_to_ndjson[.code] schema. It's specifically intended to be used when importing customer profile custom fields and can't be used for commerce transaction records. If you have a spreadsheet you want to convert into a NDJSON, follow the detailed instructions here. The script provided will map the data, specifically the headers in the CSV, so it can be parsed using [.code]lexer_schema[.code].

For example, your CSV data might look something like this:

link.customer_id custom_fields.loyalty_points
1 600

This will be converted into the following:

{"link": {"customer_id": "1", "system_name": null}, "email": null, "email_sha256": null, "mobile": null, "customer_id": null, "custom_fields": {"loyalty_points": "600"}, "first_name": null, "last_name": null, "gender": null, "date_of_birth": null, "country": null, "state": null, "city": null, "postcode": null, "zip": null, "employee_flag": null, "customer_type": null, "address_1": null, "address_2": null}

Once converted you can upload the data using the our File Upload API.

If you don't have the capability to do this, you can still send through a CSV using the steps below.

Steps to provide CSV data to Lexer

  1. Review the columns of your CSV data, are they well labeled? Is there any unnecessary data?
    [.in]- Feel free to reach out to your Account Manager for help in validating the use cases against data provided.[.in]
  2. Generate your CSV file, and check that the data is clean and matches the formatting rules below.
  3. Name the file as per the naming convention below.
  4. Determine the process for delivering the data.[.in]
    [.in]- SFTP/S3: Upload using SFTP or Upload using S3[.in]
    [.in]- File Uploader: Read File Upload API for specifics.[.in]
    [.in]- Custom: Chat with your Lexer contact.
  5. Transfer the data.
  6. Notify with your Lexer contact.

File naming

Files must be named using the following format: 

[.code]{content_descriptor}-{date}-{version}.csv[.code] 

This format consists of the following three parts:

  1. Content Descriptor: A short description of the files contents, separated by an underscore `_`.
  2. Date: An ISO8601 date for the file, reflecting the contents or date of file generation.
  3. Version: An optional version identifier. We recommend using versions. This allows you to easily revert to an old file if you identify any issues with the current version.

File names are case-sensitive, and may not contain special characters other than an hyphen '-', or an underscore '_'.

File naming examples

Let’s look at an example for a fictional competition made on August 29th, 2022:

  • [.code]summer_holiday_compeition_results-20220829.csv[.code]

In the case where a file might need to be overwritten with a newer version, you can add an additional suffix. This will update the file currently being used, while keeping the old file: 

  • [.code]summer_holiday_compeition_results-20220829-a.csv[.code]
  • [.code]summer_holiday_compeition_results-20220829-b.csv[.code]

The higher suffix will cause the newer version to be used in place of previous versions. In these examples [.code]summer_holiday_compeition_results-20220829-a.csv[.code] will be ignored, and [.code]summer_holiday_compeition_results-20220829-b.csv[.code] used.

Equally, you could simply delete the [.code]summer_holiday_compeition_results-20220829-a.csv[.code] file entirely if necessary, although this is not the recommended option.

Formatting your CSV

Column values

Column values should not exceed 1,000 characters. Any characters over this limit may be trimmed.

Double-quote values with commas

If a value contains a comma `,` it must be surrounded by double-quotes to ensure the integrity of the CSV columns. We recommend putting all values in double-quotes.
We use the standards, outlined in RFC4180, for double quotes used to enclose fields. Use a doubled double quote `""`, to indicate a double quote character in the data, and enclose this with double quotes. 

For example:

[.code]"aaa","b""bb","ccc"[.code]

Column names and order

Ensure that column names are well defined for their use for later reference.

The order of the columns does not matter, but we recommend placing identifiers in the first column to help navigate throughout the file if necessary. 

File encoding

We recommend UTF-8 (without BOM encoding).

Normalize empty values

Some rows might not contain a value for each column. Make sure that these columns are empty and do not contain placeholder values such as "null", "empty", "blank", etc.

Need some help?

If you are having any issues with this process please reach out to your Success Manager of Lexer Support.

Updated:
April 26, 2025
Did this page help you?
Thank you! Your feedback has been received!
Oops! Something went wrong while submitting the form, for assistance please contact support@lexer.io
Welcome to Lexer!
Fundamentals
Getting started
Javascript Tag basics
Data Platform
Javascript Tag
Data in the CDXP
Fundamentals
Getting started
Our glossary
Fundamentals
Getting started
Integrations overview
Fundamentals
Integrations
Onboarding data with Lexer
Data Platform
Data Onboarding
Data onboarding process
Data Platform
Data Onboarding
Importing CSV data
Data Platform
Data Onboarding
Importing JSON data
Data Platform
Data Onboarding
Secure file uploads
Data Platform
Data Onboarding
SFTP uploads and exports
Data Platform
Data Onboarding
AWS S3 uploads and exports
Data Platform
Data Onboarding
Lexer's attributes
Data Platform
Data Types
Predictive attributes
Data Platform
Data Types
Lexer API overview
Data Platform
Developer APIs
Understanding APIs
Data Platform
Developer APIs
API authentication
Data Platform
Developer APIs
API rate limits
Data Platform
Developer APIs
Bulk write API
Data Platform
Developer APIs
Profile read API
Data Platform
Developer APIs
Activity overview
Insights
Activity
Team report
Insights
Activity
Cases report
Insights
Activity
NPS report
Insights
Activity
Listen overview
Insights
Listen
Searching in Listen
Insights
Listen
Tier filters
Insights
Listen
Saved dives
Insights
Listen
Boolean search
Insights
Listen
Listen CSV exports
Insights
Listen
Visualize overview
Insights
Visualize
Curate image feed
Insights
Visualize
Respond overview
Engagement
Respond
Identity Resolution
Fundamentals
Getting started
My account
Fundamentals
Setup
Manage team
Fundamentals
Setup
Group permissions
Fundamentals
Setup
Classifications
Fundamentals
Setup
Out of the box segments
Fundamentals
Setup
Lexi your AI companion
Fundamentals
Getting started
Browser guide
Fundamentals
Security
Corporate networks
Fundamentals
Security
Multi-factor authentication
Fundamentals
Security
Single sign-on
Fundamentals
Security
Lexer's ultimate troubleshooting guide
Fundamentals
Troubleshooting
Troubleshooting tech issues
Fundamentals
Troubleshooting
Troubleshooting integrations
Fundamentals
Troubleshooting
Troubleshooting Activate
Fundamentals
Troubleshooting
Troubleshooting Respond
Fundamentals
Troubleshooting
Help! My data is missing from the Hub
Fundamentals
Troubleshooting
Lexer data specification
Data Platform
Data Specification
Customer data specification
Data Platform
Data Specification
Commerce data specification
Data Platform
Data Specification
Marketing data specification
Data Platform
Data Specification
Compliance data specification
Data Platform
Data Specification
Data formatting and validation
Data Platform
Data Specification
Product imagery
Data Platform
Data Specification
Currency conversion
Data Platform
Data Specification
Dataset management
Data Platform
Data Management
Getting started with Logs
Data Platform
Data Management
Respond chatbot API
Data Platform
Developer APIs
Activity API
Data Platform
Developer APIs
Lexer Forms overview
Data Platform
Forms
Form builder workflow
Data Platform
Forms
Form conditional logic
Data Platform
Forms
Form settings
Data Platform
Forms
Form segmentation
Data Platform
Forms
Form response analysis
Data Platform
Forms
Hidden form fields
Data Platform
Forms
Javascript Tag technical guide
Data Platform
Javascript Tag
Javascript Tag use cases
Data Platform
Javascript Tag
Javascript Tag: Shopify Custom Pixel
Data Platform
Javascript Tag
CRM data
Data Platform
Data Types
Transaction data
Data Platform
Data Types
Email engagement data
Data Platform
Data Types
Experian data enrichment
Data Platform
Data Types
Customer Service data
Data Platform
Data Specification
GDPR and CCPA requests
Fundamentals
Compliance
File upload API
Data Platform
Developer APIs
Segment overview
Insights
Segment
Creating segments
Insights
Segment
Smart Search
Insights
Segment
Profile tab
Insights
Segment
Event Explorer
Insights
Segment
Attribute value types
Data Platform
Data Types
Compare segments
Insights
Compare
Compare attributes
Insights
Compare
Activate overview
Engagement
Activate
Segment activations
Engagement
Activate
Event activations
Engagement
Activate
Activation field mapping
Engagement
Activate
Audience splits
Engagement
Activate
A/B splits
Engagement
Activate
Control group splits
Engagement
Activate
Inbox filtering
Engagement
Respond
Ignored Senders
Engagement
Respond
Forms in Respond
Engagement
Respond
Workflow states
Engagement
Respond
Bulk changes
Engagement
Respond
Scheduled replies
Engagement
Respond
Message templates
Engagement
Respond
Finding conversations
Engagement
Respond
Customer profiles
Engagement
Respond
Grouped messages
Engagement
Respond
Automation rules
Engagement
Respond
Redact messages
Engagement
Respond
Routing customer replies
Engagement
Respond
Interact with comments
Engagement
Respond
Respond workflow tips
Engagement
Respond
Contact Reporting
Engagement
Contact
Contact Queue Filters
Engagement
Contact
Contact WhatsApp Queues
Engagement
Contact
Schedule overview
Engagement
Schedule
Serve overview
Engagement
Serve
Installing Serve
Engagement
Serve
Serve user management
Engagement
Serve
Forms in Serve
Engagement
Serve
Configuring Serve
Engagement
Serve
Serve reports
Engagement
Serve
Serve Currency
Engagement
Serve
Serve POS QR Code
Engagement
Serve
Activate CSV export
Engagement
Activate
Track overview
Insights
Track
Track Tables
Insights
Track
Report overview
Measure
Listen
Lexer Product Recommender → Klaviyo Integration
Grow
Lexer Product Recommender → Klaviyo Integration
Where do your best customers live? Use geographic insights to maximize media spend and conversion
Grow
Where do your best customers live? Use geographic insights to maximize media spend and conversion
Suppression audiences: How to use them and maximize your media effectiveness
Enrich
Suppression audiences: How to use them and maximize your media effectiveness
Measure campaign effectiveness: Track your KPIs and report on campaign performance
Enrich
Measure campaign effectiveness: Track your KPIs and report on campaign performance
Converting prospects: Acquire customers from your current, engaged prospect base (and save your ad spend!)
Acquire
Converting prospects: Acquire customers from your current, engaged prospect base (and save your ad spend!)
Understanding customer intent: Effective message personalization for buyers who shop outside their gender
Grow
Understanding customer intent: Effective message personalization for buyers who shop outside their gender
Deepen customer understanding: Use third-party data to identify insights for personalized messaging and increased engagement
Grow
Deepen customer understanding: Use third-party data to identify insights for personalized messaging and increased engagement
Basket analysis: Increasing customer lifetime value through targeted product bundling
Grow
Basket analysis: Increasing customer lifetime value through targeted product bundling
Persona building: Personalize your messaging for maximum return on your campaign investments
Grow
Persona building: Personalize your messaging for maximum return on your campaign investments
Driving customer loyalty: Identify, keep, and grow your most loyal customers
Retain
Driving customer loyalty: Identify, keep, and grow your most loyal customers
Increasing customer lifetime value: Upselling strategies
Grow
Increasing customer lifetime value: Upselling strategies
Reactivating lapsed customers: Retention and growth
Retain
Reactivating lapsed customers: Retention and growth
Welcome offer strategies: Using the Hub for analysis
Acquire
Welcome offer strategies: Using the Hub for analysis
Creating customer forms: Best practices
Enrich
Creating customer forms: Best practices
Connecting your MarTech stack with Lexer!
Enrich
Connecting your MarTech stack with Lexer!
Identifying win-back customers using the Second Last Order: Date attribute
Retain
Identifying win-back customers using the Second Last Order: Date attribute
Understanding customers' purchasing habits: Order Sequence filter
Grow
Understanding customers' purchasing habits: Order Sequence filter
Maximizing customer communications in Respond
Retain
Maximizing customer communications in Respond
Using Product Recommendation in the Hub to encourage repeat purchases
Grow
Using Product Recommendation in the Hub to encourage repeat purchases
Encouraging customer loyalty using birthday campaigns
Retain
Encouraging customer loyalty using birthday campaigns
Increasing customer lifetime value: Converting your one-time buyers into two-time buyers
Grow
Increasing customer lifetime value: Converting your one-time buyers into two-time buyers
Collecting zero-party data using Lexer Forms
Enrich
Collecting zero-party data using Lexer Forms
Measuring your data over time with Track
Enrich
Measuring your data over time with Track
UTM Creation Guidelines
UTM Creation Guidelines
UTM Creation Guidelines
Brand Assets
Brand Assets
Brand Assets
GTM guide to creating marketing materials with Lexer
GTM guide to creating marketing materials with Lexer
GTM guide to creating marketing materials with Lexer
How to use the Lexer Form Builder
How to use the Lexer Form Builder
How to use the Lexer Form Builder
Explore our standard integrations
Explore our standard integrations
Explore our standard integrations
Operating a CDP Practice LP
Operating a CDP Practice LP
Operating a CDP Practice LP
LP Sales Enablement
LP Sales Enablement
LP Sales Enablement
Video Training Courses LP
Video Training Courses LP
Video Training Courses LP
Purpose and Mission
Purpose and Mission
Purpose and Mission
Brand & Marketing LP
Brand & Marketing LP
Brand & Marketing LP
Stage 3 - QBRs and Customer insights
Stage 3 - QBRs and Customer insights
Stage 3 - QBRs and Customer insights
Client Onboarding Journey
Client Onboarding Journey
Client Onboarding Journey
Start your CDP Practice
Start your CDP Practice
Start your CDP Practice
Lexer Messaging
Lexer Messaging
Lexer Messaging
Pain point conversations
Pain point conversations
Pain point conversations
Lexer Ideal Customer Profile & Positioning
Lexer Ideal Customer Profile & Positioning
Lexer Ideal Customer Profile & Positioning
Referral Partner Program Overview
Referral Partner Program Overview
Referral Partner Program Overview
Demo Hub Guide
Demo Hub Guide
Demo Hub Guide