When you try to import a JSON file into Notion, you may see an error message stating that the import cannot process files with nested arrays. This happens because Notion’s import tool is designed to flatten data into a single table structure, and nested arrays represent multi-level data that does not map directly to Notion database columns. This article explains why this error occurs and provides step-by-step methods to restructure your JSON file so that Notion can successfully import it.
Key Takeaways: Fixing JSON Nested Array Import Errors in Notion
- Flatten nested arrays into separate rows: Each element of a nested array becomes its own row in the Notion database, with parent data duplicated if needed.
- Use a JSON-to-CSV converter before importing: Notion imports CSV files more reliably; converting your JSON to CSV with flattened arrays avoids the nested array error entirely.
- Use Notion API for complex imports: If your data has deeply nested structures, programmatic import via the Notion API gives you full control over how arrays are handled.
Why Notion Cannot Process JSON Files With Nested Arrays
Notion’s import tool expects a flat, tabular structure where each row represents a single record and each column represents a simple value such as text, number, or date. When your JSON file contains nested arrays — for example, an array of tags or a list of sub-items — the import tool cannot decide how to map that structure onto a single row in a database table. The tool interprets the nested array as a complex object that does not fit into a single cell.
Technically, Notion’s import engine uses a CSV-like parser internally. JSON arrays that contain other arrays or objects break this parser because they introduce variable-length data that cannot be represented as a fixed set of columns. The error you see is a safety mechanism: Notion refuses to guess how to flatten the data and instead rejects the file outright.
What Types of Nested Arrays Cause the Error
The error occurs with any JSON structure that contains an array whose elements are themselves arrays or objects. Examples include:
- An array of tags:
"tags": ["urgent", "project-x"]— this is actually a simple array and does NOT cause the error. Notion can import simple arrays as comma-separated text. - An array of objects:
"items": [{"name": "A", "price": 10}, {"name": "B", "price": 20}]— this WILL cause the error because each object contains multiple fields. - An array of arrays:
"coordinates": [[1,2], [3,4]]— this WILL cause the error because the inner arrays are not simple values.
Steps to Restructure Your JSON File for Notion Import
The only reliable way to import JSON with nested arrays into Notion is to flatten the data before importing. Below are three methods, starting with the most straightforward manual approach and moving to programmatic solutions.
Method 1: Manually Flatten Nested Arrays Into Separate Rows
This method works best when you have a small JSON file with one level of nesting. You create a new JSON file where each element of the nested array becomes its own top-level object, and you duplicate the parent fields as needed.
- Identify the nested array
Open your JSON file in a text editor. Locate the array that contains objects or arrays. For example, a file with a “projects” array where each project has an “items” array. - Create a new flat JSON structure
For each element inside the nested array, create a new object that includes all parent fields plus the fields from the nested element. For a project named “Alpha” with items [{“name”: “Task 1”, “status”: “Done”}, {“name”: “Task 2”, “status”: “Pending”}], you would create two objects: one for Task 1 and one for Task 2, each with the project name “Alpha”. - Save the flat JSON file
Save the new file with a different name, such as “flattened-projects.json”. Ensure the file contains an array of flat objects with no nested arrays or objects. - Import into Notion
Go to Settings & Members > Settings > Import. Select JSON and upload your flattened file. Notion will now process the file without the nested array error.
Method 2: Convert JSON to CSV Using a Script or Online Tool
Notion imports CSV files without the nested array limitation because CSV inherently represents flat data. Converting your JSON to CSV with proper flattening bypasses the error entirely.
- Use a JSON-to-CSV converter with flattening support
Search for an online tool like ConvertCSV or use a Python script with the pandas library. These tools can flatten nested JSON automatically by creating new columns for nested fields. - Configure the flattening options
In the converter, enable options like “flatten nested arrays” or “expand arrays into rows”. Some tools let you choose between creating separate columns or separate rows. For Notion, choose “expand into rows” so each nested element becomes a new row. - Download the CSV file
After conversion, download the CSV file. Open it in a spreadsheet editor to verify that no nested structures remain. Each column should contain a single value per row. - Import the CSV into Notion
In Notion, select Settings & Members > Settings > Import. Choose CSV and upload your flattened CSV. Notion will create a new database with all rows and columns.
Method 3: Use the Notion API for Programmatic Import
If your JSON has deeply nested structures or you need to import data regularly, the Notion API gives you full control over how each field is mapped to database properties.
- Create a Notion integration
Go to Notion Integrations page and create a new integration. Copy the API token. - Write a script that reads your JSON and creates database pages
Using Python or JavaScript, parse your JSON file. For each top-level object, create a new page in your Notion database. For nested arrays, decide how to handle them: either concatenate values into a text property, create a relation to another database, or use a multi-select property if the array contains simple strings. - Run the script
Execute your script. It will send POST requests to the Notion API to create each page. The script can handle nested arrays by converting them to Notion property types that support multiple values, such as multi-select or relation. - Verify the imported data
Open your Notion database and check that all fields are populated correctly. Nested arrays that were converted to multi-select properties will appear as tags.
If Notion Still Has Issues After Restructuring
Imported File Shows Empty Columns
If after flattening your JSON some columns appear empty, the original JSON likely had missing keys for certain objects. Ensure every object in your flat array contains the same set of keys. Use a JSON validator to check for inconsistent key names.
Notion Imports Only the First Row
This can happen if your JSON file is not an array of objects but a single object with nested arrays. Wrap your entire content in square brackets to make it an array. For example, change {"projects": [...]} to [{"projects": [...]}] and then flatten as described.
Comma-Separated Values Are Not Parsed Correctly
If your flattened JSON contains fields with commas inside text, Notion may misinterpret them as separate columns when importing as CSV. Use a proper CSV escape method: wrap any field containing commas in double quotes. Most JSON-to-CSV converters handle this automatically.
| Item | Manual Flattening | JSON-to-CSV Conversion | Notion API |
|---|---|---|---|
| Best for | Small files with one level of nesting | Medium files with moderate nesting | Large or deeply nested files, recurring imports |
| Technical skill required | Basic text editing | Using online tools or running a script | Programming (Python or JavaScript) |
| Handles simple arrays | Yes | Yes | Yes |
| Handles arrays of objects | Yes, but manually | Yes, with flattening options | Yes, with custom mapping |
| Handles arrays of arrays | Yes, but manually | Yes, with flattening options | Yes, with custom mapping |
| Risk of data loss | Low if done carefully | Low with good converter | Low if script is correct |
You can now import JSON files with nested arrays into Notion by flattening the data first. For future imports, consider using the JSON-to-CSV conversion method as it is faster and less error-prone than manual flattening. If you work with complex data regularly, invest time in setting up a Notion API script that automates the entire import process.