Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions export_bg/models/export_bg_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,18 @@ def _export_chunk_bg(self, data, export_id, export_format):
]
)

field_names = [f.get("name") or f.get("value") or f.get("id") for f in params["fields"]]
field_labels = [f.get("label") or f.get("string") for f in params["fields"]]
# Extract field names considering import_compat mode
import_compat = params.get("import_compat", True)

# For field_names (data extraction), always use the technical field name
# Only use 'value' as fallback when import_compat=True (for import compatibility)
if import_compat:
field_names = [f.get("name") or f.get("value") or f.get("id") for f in params["fields"]]
field_labels = field_names # Use field names as headers for import compatibility
else:
# When not import_compat, use only 'name' or 'id' for field_names, not 'value'
field_names = [f.get("name") or f.get("id") for f in params["fields"]]
field_labels = [f.get("label") or f.get("string") for f in params["fields"]]

export_data = self.export_data(field_names).get("datas", [])

Expand Down