-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Description
Describe the Bug
When exporting data with the fields parameter to select specific fields (e.g., fields: ['member']), the export fails to include nested/child fields that should be included when using the toCSV functionality.
This regression was most likely introduced in PR #14782 which refactored the plugin.
Data is missing from both the export file as well as the preview table.
Current behaviour: Export File Contains:
id,member
1,user_id_herePreview Table Shows:
- Only column header: "member"
- Missing:
member_name,member_email
What's Missing:
member_namecolumn (should show "John Doe")member_emailcolumn (should show "john@example.com")
Expected behaviour: Export File Contains:
id,member_name,member_email
1,"John Doe","john@example.com"Preview Table Shows:
- Column headers: "id", "member_name", "member_email"
- Data properly displayed in all columns
Link to the code that reproduces this issue
https://github.com/dnd-gent/payloadcms-export-regression
Reproduction Steps
Reproduction Steps
1. Setup Environment
# Clone the reproduction repository
git clone https://github.com/dnd-gent/payloadcms-export-regression
cd payloadcms-export-regression
# Install dependencies
pnpm install
# Start the development server
pnpm dev2. Create Test Data
- Navigate to http://localhost:3000/admin
- Go to Users collection
- Create a user:
- Name: "John Doe"
- Email: "john@example.com"
- Password: (set your password)
- Go to Signups collection
- Create a signup:
- Member: Select "John Doe"
- Status: "confirmed"
- Save
3. Reproduce the Bug
- In the Signups collection list view
- Click the "Export" button
- In the export dialog:
- Format: CSV
- Fields:
["member"]
- Click "Preview" to see the preview table
4. Observe the Issue
Which area(s) are affected?
plugin: import-export
Environment Info
Binaries:
Node: 20.20.0
npm: 10.8.2
Yarn: 1.22.22
pnpm: 10.28.1
Relevant Packages:
payload: 3.73.0
next: 15.4.10
@payloadcms/db-sqlite: 3.73.0
@payloadcms/drizzle: 3.73.0
@payloadcms/graphql: 3.73.0
@payloadcms/next/utilities: 3.73.0
@payloadcms/plugin-import-export: 3.73.0
@payloadcms/richtext-lexical: 3.73.0
@payloadcms/translations: 3.73.0
@payloadcms/ui/shared: 3.73.0
react: 19.2.1
react-dom: 19.2.1
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:45 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6030
Available memory (MB): 36864
Available CPU cores: 12
Reactions are currently unavailable