Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV Export places #536

Closed
MonicaG opened this issue Feb 8, 2023 · 1 comment
Closed

CSV Export places #536

MonicaG opened this issue Feb 8, 2023 · 1 comment

Comments

@MonicaG
Copy link

MonicaG commented Feb 8, 2023

Describe the bug

Data is not placed in the correct columns when exporting submissions to CSV. The columns affected are those that were conditionally displayed.

To Reproduce

Steps to reproduce the behavior:

  1. Create a form that contains fields that use conditional logic.
  2. Create form submissions where there are submissions that use the conditional fields and submissions that don't
  3. Export the data as CSV
  4. Open the CSV file. The conditional field data will be placed in the wrong column

Expected behavior

Data should appear in the correct columns

Screenshots

If you need example data I can share the exported CSV file.

Desktop (please complete the following information)

  • OS: MacOS Ventura 13.1
  • Browser: Safari
  • Version: 16.2

Additional context

I was able to get around the problem by exporting the data as json. I then used the jq command line tool to convert it to CSV via the following command:

cat submissions.json | jq -r '(. | map(leaf_paths) | unique) as $cols | map (. as $row | ($cols | map(. as $col | $row | getpath($col)))) as $rows | ([($cols | map(. | map(tostring) | join(".")))] + $rows) | map(@csv) | .[]' > output.csv

Reference

I wanted to share this work around incase anyone else needs it.

@WalterMoar
Copy link
Collaborator

Hello @MonicaG - This problem was fixed recently in #892

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants