Skip to content

plugin-import-export incorrectly exports documents as .csv format instead of .json #12546

@Dince-afk

Description

@Dince-afk

Describe the Bug

When I use the import-export plugin to export collection data as a .json file it returns a .json file but the data in it is formatted in .csv format.

Also a side note feature update request: It would be great if "all columns/fields" is the default option when using the export plugin feature.

Image

Link to the code that reproduces this issue

https://github.com/Dince-afk/payloadcms-bugs

Reproduction Steps

  1. Initialize payload admin app (I used vercel/neon postgres db)
  2. Run seed script for target translations collection (npm run payload run scripts/seed.js)
  3. Run local dev server and go to translations collection page
  4. Use the export button
  5. Select Language, IsActive, LanguageNativeName columns.
Image 6. Select JSON as export format 7. Click download

Expected:
The resulting .json file to have data in it as standard JSON format.

Result:
I did get a .json file but the data inside is formatted as a .csv file

Image

Which area(s) are affected? (Select all that apply)

plugin: other

Environment Info

Binaries:
  Node: 22.16.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.11.0
Relevant Packages:
  payload: 3.39.1
  next: 15.3.0
  @payloadcms/email-nodemailer: 3.39.1
  @payloadcms/graphql: 3.39.1
  @payloadcms/next/utilities: 3.39.1
  @payloadcms/payload-cloud: 3.39.1
  @payloadcms/plugin-import-export: 3.39.1
  @payloadcms/richtext-lexical: 3.39.1
  @payloadcms/translations: 3.39.1
  @payloadcms/ui/shared: 3.39.1
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:32:43 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T8103
  Available memory (MB): 8192
  Available CPU cores: 8

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions